Time goes by quickly and before you know it your Python interpreter is a few versions behind. Pip tells you that a new version is around, but Python keeps working and so we easily forget that Python itself deserves an update from time to time.
This post is part of my journey to learn Python. You can find the other parts of this series here.
What version of Python do I use?
You can run this command in your terminal to see what version you currently use:
1 2 |
$ python --version Python 3.8.1 |
In my case I installed Python as I started with the Python Friday blog series at the end of 2019. Whoops, that was a long time ago and deserves a speedy update.
Python.org
If you installed Python directly from Python.org then you should visit python.org/downloads and get the newest version.
The Installer worked the same way as the last time I run it. Make sure that you check the option “Add Python 3.x to PATH” on the first page of the installer.
When the installation finishes, open up a new terminal and check if you get the new version:
1 2 |
$ python --version Python 3.9.5 |
Anaconda
If you used Anaconda to install Python, you can open the Anaconda Prompt as Administrator (not CMD) and check what version of Python you use there:
1 2 |
python --version Python 3.7.4 |
You can enter these two commands to update Anaconda:
1 2 |
conda update conda conda install anaconda=2020.11 |
You can find out the version number via the archive, which is a rather tedious approach to locate the latest version. Version 2020.11 got me only a minor update for Python itself:
1 2 |
python --version Python 3.7.9 |
As IanSR on StackOverflow suggested, there is an other update command that you may want to use:
1 |
conda update --all |
This got me to the latest version of Python 3.7:
1 2 |
python --version Python 3.7.10 |
I did know that Anaconda is a bit behind on new versions, but I did not expect that is that far behind. Therefore, if you want to use a current version of Python, go to Python.org and install it from there.
Conclusion
It is easy to forget to update your Python installation. Getting a current version from Python.org takes only a few minutes of your time. How far behind is your version?
1 thought on “Python Friday #70: Keep Your Python Version up to Date”