Windows environment variables change when opening command line?

Posted by Jakobud on Stack Overflow See other posts from Stack Overflow or by Jakobud
Published on 2010-06-03T04:32:34Z Indexed on 2010/06/03 4:34 UTC
Read the original article Hit count: 220

Sometimes when I change my environment variables in Windows, and then use software the depends on those variables, they are not properly updated.

And good example is to change a variable, then open up Windows Command Line and echo the variable and see that it hasn't been changed, even though you properly changed it in the Environment Variables window.

Another example I'm dealing with right now:

I've been using Python 2.4.x for a while for a project, which uses the env var PYTHONPATH who's value has been:

C:\Python24;C:\Python24\lib

Today I installed Python 2.5.x for the project. I changed my PYTHONPATH to be:

C:\Python25;C:\Python25\lib

When I use Python 2.5 to run a script and do this:

import sys
print sys.path

It prints:

'C:\\PYTHON24', 'C:\\PYTHON24\\lib' (and some other Python 2.5 related default installation paths)

So clearly, the old PYTHONPATH environment variable changes aren't really sticking....

Does anyone know why this happens and how to fix it?

© Stack Overflow or respective owner

Related posts about python

Related posts about command-line