Home  >  Article  >  System Tutorial  >  How to install multiple Python versions under Linux

How to install multiple Python versions under Linux

PHPz
PHPzforward
2024-04-09 18:07:231148browse
How to install multiple Python versions under Linux
Download Python source code

Download the source files from http://www.python.org/download/.

Compile and install
tar zxvf Python-2.7.6.tgz

cd Python-2.7.6

./configure --prefix=/usr/local/python-2.7.6    #重要,指定python的安装路径,可以自己设置。

make

sudo make install
Modify Python soft chain

The default python command is in the /usr/bin/ directory. You need to modify the soft link here to version 2.7 and create a 2.4 soft link.

mv /usr/bin/python /usr/bin/python2.4   #根据需要来

ln -s /usr/local/python-2.7.6/bin/python /usr/bin/python 

The above is the detailed content of How to install multiple Python versions under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete