
Note: This method of changing environment variables is not permanent and is only active in the current terminal session. $ ln -s /usr/bin/python2-config ~/bin/python-configįinally put the new folder at the beginning of your PATH variable: Then add a symlink python to python2 and the configuration scripts in it: This trick relies on env searching for the first corresponding entry in the PATH variable.


It only works if the scripts use #!/usr/bin/env python. In either case, change python to python2 and the program will then use Python 2 instead of Python 3.Īnother way to force the use of python2 without altering the scripts is to call it explicitly with python2:įinally, you may not be able to control the script calls, but there is a way to trick the environment. To change this, open the program or script in a text editor and change the first line. However, many legacy Python 2 scripts incorrectly specify python in their shebang line. You need to specify python2 in order to run this version.Īny program requiring Python 2 needs to use /usr/bin/python2, instead of /usr/bin/python, which points to Python 3. Python 2 will happily run alongside Python 3. To get the last version of Python 2, install the python2 package. Python 2 may also be useful for developers maintaining, using or porting legacy Python 2 software. For an overview of the differences, see the historical version of the Python2orPython3 document.Īlthough Python 2 is no longer actively maintained, there are some packages that still depend on it.

Python 2 is an older version of the language. A small number of packages still depend on Python 2 but that version of Python will not be maintained further. Warning: Python 2 reached its end of life on January 1st of 2020. You can also download the source for any release on the page. You can also use pyenv to easily switch between multiple versions of Python. searching for python37 for Python 3.7 modules. Python 3.10: Current release, see previous sectionĮxtra modules/libraries for old versions of Python may be found on the AUR by searching for python, e.g.Previous and future versions of Python are available via the AUR, and may be useful for old applications that do not run on the current version, for programs intended to run on other versions, or just for curiosity: Install the python package, which provides the current release of Python 3. See What's New in Python for the latest changes in Python 3.

Python 3 is the current version of the language and is in active development.
