

In addition to the above example making use of make altinstall instead of make install, there are many ways to install a new version of Python in a "closed" environment without interfering with the primary installation of the OS distribution.įor example, here's how to install Python under /opt by creating a "closed" environment ( /opt is indicated for installations of third party packages, which are not part of the official OS distribution, which installs rather in /bin, /usr/bin). It is important not to modify (or destroy) the Python version installed by the Ubuntu Linux distribution, because there are dependencies to be respected within the OS distribution itself. How to protect the pre-installed Python of the OS distribution In any case such an error would not prevent us to use this new Python version, freshly installed. pythonstartup (which is why we compiled with the libreadline-dev dependency). Indeed, while launching this new version of Python, we could see an import error package for readline from the launching file. Type "help", "copyright", "credits" or "license" for more information. usr/bin/install −c python /usr/local/bin/python2.7.2 (rather than "sudo make install" to not interfere with the OS pre-installed version )

Gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 Make altinstall is used to prevent replacing the default python binary file /usr/bin/python.Ĭheck the latest version installed of python using below command # python2.Connecting to |82.94.164.162 |:80. Use below set of commands to compile python source code on your system using altinstall. You can also download latest version in place of specified below. $ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev Download Python 2.7.13ĭownload Python using following command from python official site. $ sudo apt-get install build-essential checkinstall Use the following command to install prerequisites for Python before installing it. To install Python 3.4.5 visit following article. At writing time of this article Python 3.4.5 latest stable version is available to download and install. This article will help you to install Python 2.7.13 on your Ubuntu, Debian and LinuxMint operating systems.
