[osgeo4w-dev] PATH variable issue

Matt Wilkie matt.wilkie at gov.yk.ca
Mon Dec 10 09:17:21 PST 2012

Hi Klo,   welcome to Osgeo4w :)

We choose to add osgeo4w PATH at the end of the system path on purpose, 
in order to play lightly and cooperatively with what is already there.  
If we changed to inserting o4w to the beginning of PATH there would be 
other people upset because now our exe's and dll's would be found first 
instead of something else. Unfortunately there is no solution for all. 
I'm happy that you at least have found a solution for your environment.

In any case, o4w at beginning or end of path doesn't solve the 
fundamental problem: multiple and possibly conflicting installs of the 
same thing in one system. Without a fair amount of work keeping each of 
them in sync (same modules installed for each) you'll often run into 
trouble, and troubleshooting is a real pain. It's really much better to 
only have one python active in the environment at a time.

One thing which /may /help, depending on the particulars of the other 
bundled python packages you mention, is to install o4w first and 
register it's python as the system default for v2.7 before installing 
the other programs. See 
http://trac.osgeo.org/osgeo4w/wiki/ExternalPythonPackages and 

best regards,

matt wilkie
Geomatics Analyst
Information Management and Technology
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax

On 10/12/2012 7:40 AM, klo uo wrote:
> Hi,
> Let me introduce myself:
> I'm new osgeo4w user, after I discovered gdal and qgis.
> I tried it because I started to dislike programs that ship own Python 
> on board. Believe it or not but I can name more then 5 programs in my 
> current setup that have own Python distribution aside my system Python 
> distribution (and it's is a same version!).
> Compiling qgis OTOH is not worth to avoid this nuisance, but 
> installing environment like osgeo4w is what I found excellent choice.
> Now, I have one issue with osgeo4w shell - osgeo4w sets it's path as 
> last item in PATH variable, so if some executable is found in prior 
> set directories it will be executed instead osgeo4w version, like I 
> just experienced. Here is how osgeo4w sets path 
> (http://i.imgur.com/AjEJV.png):
> Inline image 1
> I opened OSGeo4W.bat to see how it sets variables, and then see it 
> calls other batch files and all this environment variables setting is 
> over-complicated I hope for a reason, as it makes user intervention 
> unlikely. So my suggestion is whatever scripts sets PATH variable to 
> set it like this:
>     set path=%osgeo4w-path%;%path%
> instead:
>     set path=%path%;%osgeo4w-path%
> That way command clashing can be avoided. At least for the issue I 
> had, when program from my system Python scripts was executed 
> unsuccessfully instead from osgeo4w Python script folder.
> Cheers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/osgeo4w-dev/attachments/20121210/de3ef058/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 43463 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/osgeo4w-dev/attachments/20121210/de3ef058/attachment-0001.png>

More information about the osgeo4w-dev mailing list