Home > System Tutorial > LINUX > body text

How to install multiple Python versions under Linux

PHPz
Release: 2024-04-09 18:07:23
forward
1174 people have browsed it
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
Copy after login
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 

Copy after login

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!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!