I have Python 3.5 installed.I previously installed Python 3.4 from source and managed to uninstall it somehow. Now if I try to install Python 3.4 through apt-get install python3.4 , it returns
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libpython3.4-minimal' for regex 'python3.4'
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.Directly executing python3.4 --version does't work as well. What should I do?
1 Answer
As you can see from , there is no package for python3.4 for Ubuntu 16.04. You can compile and install Python 3.4 from source, but if you are not familiar with doing it or prefer to install packages using the APT package manager, I would recommend installing it from a well-known PPA that provides a variety of versions of Python for many Ubuntu versions.
Add the
deadsnakesPPA (read more about it at ):sudo add-apt-repository ppa:deadsnakes/ppaInstall
python3.4:sudo apt-get update sudo apt-get install python3.4
According to ,/usr/bin/python3 should still be symlinked to /usr/bin/python3.5. Therefore, if you want to call Python 3.4, you would need to type the full path to it, which is /usr/bin/python3.4. To avoid accidentally breaking other programs, I strongly recommend you to not change the symlink that /usr/bin/python3 points to and instead just use /usr/bin/python3.4 whenever you need to call Python 3.4.
Alternatively, a popular method to manage multiple versions of Python, which I personally recommend, is to use virtualenv. You can read more about it at ; further elaboration of it in this post seems too far off the intent of the question.