Opened 14 years ago
Closed 14 years ago
#208 closed defect (worksforme)
OSGeo4w shell: Environment not set correctly to use python with qgis bindings
Reported by: | milovanderlinden | Owned by: | |
---|---|---|---|
Priority: | major | Component: | Installer |
Version: | Keywords: | install shell qgis python | |
Cc: |
Description
Reproduce:
- run installer from scratch on a fresh windows xp sp2 virtual machine
- Select advanced install
- check qgis, qgis-grass-plugin and "shell: OSGeo4w Command shell"
- Install
- Start shell by double clicking OSGeo4w shell icon on desktop
- >python
- >>>import qgis.core
You will be told qgis.core cannot be found.
External links: http://desktopgisbook.com/Creating_a_Standalone_GIS_Application_1
Change History (2)
follow-up: 2 comment:1 by , 14 years ago
comment:2 by , 14 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Replying to milovanderlinden:
Solution I took:
- Add a qgis.bat file in the directory: %OSGEO4W_ROOT%\etc\ini
- Put this as content in the file:
SET PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python PATH=C:\OSGeo4W\apps\qgis\bin;%PATH%
A better option would be to create a batch file like qgis.bat
to start the application that is using qgis.core
. Adding a qgis.bat
to etc/ini
might interfere with install of multiple qgis versions.
Note:
See TracTickets
for help on using tickets.
Solution I took:
SET PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python PATH=C:\OSGeo4W\apps\qgis\bin;%PATH%