[osgeo4w-dev] [osgeo4w] #282: python path getting overwritten

OSGeo4W trac_osgeo4w at osgeo.org
Thu Mar 29 17:40:29 PDT 2012


#282: python path getting overwritten
--------------------+-------------------------------------------------------
Reporter:  lpinner  |       Owner:  osgeo4w-dev@…              
    Type:  defect   |      Status:  new                        
Priority:  minor    |   Component:  Package                    
 Version:           |    Keywords:                             
--------------------+-------------------------------------------------------
 In %OSGEO4W_ROOT%\bin\o4w_env.bat the \etc\ini\*.bat files are called in a
 loop (alphabetically i presume). When %OSGEO4W_ROOT%\etc\ini\orfeotoolbox-
 python.bat gets called, it sets PYTHONPATH to
 %OSGEO4W_ROOT%\apps\orfeotoolbox\python. This gets overwritten when
 %OSGEO4W_ROOT%\etc\ini\python.bat is called afterwards i.e. SET
 PYTHONPATH=%OSGEO4W_ROOT%\apps\Python27.

 This causes QGIS to report an error on startup ("Could not find the Python
 bindings for OrfeoToolbox, which are required to run the this module") and
 breaks the python bindings in the osgeo4w shell generally.

 Perhaps these batch files should set PYTHONPATH by appending/prepending,
 i.e. for etc\ini\python.bat:

 {{{
 SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27
 }}}
 or
 {{{
 IF "%PYTHONPATH%"=="" (
     SET PYTHONPATH=%OSGEO4W_ROOT%\apps\Python27
 ) ELSE (
     SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27
 )
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/osgeo4w/ticket/282>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list