8

I had Python2.6 on my Windows 7 and I just installed Python2.7. As a result I have "C:\Python26" and "C:\Python27".

My problem is that system still tries to use the old version. For example if I type Python --version I get "Python 2.6.4". Or, if I try to install "numpy" it find the old version and does not allow me to manually change it to the new version.

I tried to check system environment variables to find out if there is Python2.6 (to replace it by Python2.7) but I did not find anything like that.

1 Answer 1

6

You need to change Python path to the new version.

http://docs.python.org/using/windows.html#excursus-setting-environment-variables

Sign up to request clarification or add additional context in comments.

5 Comments

I checked it. I have the environment variable called PYTHONPATH but it does not have values that refer to the old version of python.
Anyway, I set PYTHONPATH=C:\Python27. Then I close all terminals and start a new one, type python --version and still get "Python 2.6.4".
I don't have much experience with windows. Don't you have to restart the system for this change to take effect?
I solved the problem. I have realized that in windows there are "user variables" and "system variables". First I checked "user variables" and did not find anything related there. But in the "system variables" I had "path" that refereed to the old version of the python. I changed the value of this variable and the problem was solved. Thank you!
@Roman: PATH is for finding programs to run at the command line. PYTHONPATH is for finding modules for Python to import.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.