Skip to main content
corrected spelling
Source Link
nmtoken
  • 13.6k
  • 5
  • 38
  • 89

I'm trying to create a standalone qgisQGIS app using pyqgis, i'llPyQGIS. I'll be deploying it by copying the install folder of qgisQGIS and source folder of my app, and so for the testing purposes iI copied qgisQGIS install folder (1.8.0) to some other computer without qgisQGIS installation to begin with; then iI tried to test the qgis.gui and qgis.core imports, but no matter what PYTHONPATH (or PATH) iI set, iI keep getting ImportError "no module named ...".

What's wirdweird is, if iI modify qgis.bat to this new location and run it, QgisQGIS opens without a problem and all imports work through console inside qgisQGIS. Then iI simply duplicated qgis.bat and removed the last line which runs qgisQGIS then added the line which runs my application instead. For some reasonsreason, imports are still unavailable, so imI'm wondering where are actual pythonPython binding files for qgis_gui.dll and qgis_core.dll because i cantI can't find them anywhere inside qgisQGIS install dirdirectory.

My .bat looks like this:

@echo off
SET OSGEO4W_ROOT=c:\IMS\Qgis
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.2\etc\env.bat
@echo on
PATH %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin;%OSGEO4W_ROOT%\apps\grass\grass-6.4.2\lib;%OSGEO4W_ROOT%\apps\qgis\python\qgis;
SET PYTHONPATH = c:\IMS\QGis\apps\qgis\bin\
python c:\IMS\IMS\ims.py

I'm trying to create a standalone qgis app using pyqgis, i'll be deploying it by copying the install folder of qgis and source folder of my app, and so for the testing purposes i copied qgis install folder (1.8.0) to some other computer without qgis installation to begin with; then i tried to test the qgis.gui and qgis.core imports, but no matter what PYTHONPATH (or PATH) i set, i keep getting ImportError "no module named ...".

What's wird is, if i modify qgis.bat to this new location and run it, Qgis opens without a problem and all imports work through console inside qgis. Then i simply duplicated qgis.bat and removed the last line which runs qgis then added the line which runs my application instead. For some reasons, imports are still unavailable, so im wondering where are actual python binding files for qgis_gui.dll and qgis_core.dll because i cant find them anywhere inside qgis install dir.

My .bat looks like this:

@echo off
SET OSGEO4W_ROOT=c:\IMS\Qgis
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.2\etc\env.bat
@echo on
PATH %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin;%OSGEO4W_ROOT%\apps\grass\grass-6.4.2\lib;%OSGEO4W_ROOT%\apps\qgis\python\qgis;
SET PYTHONPATH = c:\IMS\QGis\apps\qgis\bin\
python c:\IMS\IMS\ims.py

I'm trying to create a standalone QGIS app using PyQGIS. I'll be deploying it by copying the install folder of QGIS and source folder of my app, and so for the testing purposes I copied QGIS install folder (1.8.0) to some other computer without QGIS installation to begin with; then I tried to test the qgis.gui and qgis.core imports, but no matter what PYTHONPATH (or PATH) I set, I keep getting ImportError "no module named ...".

What's weird is, if I modify qgis.bat to this new location and run it, QGIS opens without a problem and all imports work through console inside QGIS. Then I simply duplicated qgis.bat and removed the last line which runs QGIS then added the line which runs my application instead. For some reason, imports are still unavailable, so I'm wondering where are actual Python binding files for qgis_gui.dll and qgis_core.dll because I can't find them anywhere inside QGIS install directory.

My .bat looks like this:

@echo off
SET OSGEO4W_ROOT=c:\IMS\Qgis
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.2\etc\env.bat
@echo on
PATH %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin;%OSGEO4W_ROOT%\apps\grass\grass-6.4.2\lib;%OSGEO4W_ROOT%\apps\qgis\python\qgis;
SET PYTHONPATH = c:\IMS\QGis\apps\qgis\bin\
python c:\IMS\IMS\ims.py
Source Link
U2ros
  • 5.2k
  • 5
  • 30
  • 51

Where exactly are qgis.gui and qgis.core located?

I'm trying to create a standalone qgis app using pyqgis, i'll be deploying it by copying the install folder of qgis and source folder of my app, and so for the testing purposes i copied qgis install folder (1.8.0) to some other computer without qgis installation to begin with; then i tried to test the qgis.gui and qgis.core imports, but no matter what PYTHONPATH (or PATH) i set, i keep getting ImportError "no module named ...".

What's wird is, if i modify qgis.bat to this new location and run it, Qgis opens without a problem and all imports work through console inside qgis. Then i simply duplicated qgis.bat and removed the last line which runs qgis then added the line which runs my application instead. For some reasons, imports are still unavailable, so im wondering where are actual python binding files for qgis_gui.dll and qgis_core.dll because i cant find them anywhere inside qgis install dir.

My .bat looks like this:

@echo off
SET OSGEO4W_ROOT=c:\IMS\Qgis
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.2\etc\env.bat
@echo on
PATH %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin;%OSGEO4W_ROOT%\apps\grass\grass-6.4.2\lib;%OSGEO4W_ROOT%\apps\qgis\python\qgis;
SET PYTHONPATH = c:\IMS\QGis\apps\qgis\bin\
python c:\IMS\IMS\ims.py