How to update version of Python?
38,084
You need to change Python path to the new version.
http://docs.python.org/using/windows.html#excursus-setting-environment-variables
Author by
Roman
Updated on February 24, 2020Comments
-
Roman about 4 years
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.
-
Roman about 13 yearsI checked it. I have the environment variable called PYTHONPATH but it does not have values that refer to the old version of python.
-
Roman about 13 yearsAnyway, 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". -
gruszczy about 13 yearsI don't have much experience with windows. Don't you have to restart the system for this change to take effect?
-
Roman about 13 yearsI 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!
-
Thomas K about 13 years@Roman: PATH is for finding programs to run at the command line. PYTHONPATH is for finding modules for Python to import.