本篇文章重点为大家分享一下在Linux中搭建Python2.7环境具体方法,有需要的小伙伴可以参考一下。

1.Python下载
Python下载
地址: http://www.python.org/getit/
版本: Python-2.7.3.tgz
setuptoos下载
地址:http://pypi.python.org/pypi/setuptools#downloads
版本:setuptools-0.6c11.tar.gz(md5)
采用wget方式下载:
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
2.安装Python
查看系统自带的python:

计划安装2.7.3,新建目录–下载安装包:

解压
tar -zvxf Python-2.7.3.tgz
解压后,安装Python:

./configure --prefix=/usr/local/python2.7.3
make
make install
安装成功后目录为:

建立软链接:

3.安装setuptools
采用wget下载:
[root@biao Python-2.7.3]# pwd
/python/Python-2.7.3
[root@biao Python-2.7.3]# cd ..
[root@biao python]# ll
total 13832
drwxr-x--- 18 1000 1002 4096 Dec 5 18:05 Python-2.7.3
-rwxr-xr-x 1 root root 14135620 Dec 5 17:42 Python-2.7.3.tgz
[root@biao python]# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
--18:18:59-- http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
Resolving pypi.python.org... 140.211.10.73
Connecting to pypi.python.org|140.211.10.73|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 256862 (251K) [application/octet-stream]
Saving to: `setuptools-0.6c11.tar.gz'
100%[======================================================================] 256,862 126K/s in 2.0s 18:19:25 (126 KB/s) - `setuptools-0.6c11.tar.gz' saved [256862/256862]
以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !
