Linux安装Python2.7
以下例子基于python 2.7.9,其他版本同理。#
1、下载python#
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
2、解压、编译安装(依次执行以下5条命令)#
tar -zxvf Python-2.7.9.tgz
cd Python-2.7.9
./configure --prefix=/usr/local/python-2.7.9
make
make install
3、系统自带了python版本,我们需要为新安装的版本添加一个软链#
ln -s /usr/local/python-2.7.9/bin/python /usr/bin/python2.7.9
4、若需使用该版本,只需输入"python2.7.9 + 空格 + py脚本"#
python2.7.9 ~/helloworld.py
【可选】#
假若想用python运行脚本,而不是python2.7.9,运行以下指令即可完成修改:
ln -s /usr/local/python-2.7.9/bin/python /usr/bin/python
相关推荐
以梦为马不负韶华 2020-10-20
huavhuahua 2020-11-20
weiiron 2020-11-16
cakecc00 2020-11-15
千锋 2020-11-15
JakobHu 2020-11-14
guangcheng 2020-11-13
xirongxudlut 2020-11-10
solarLan 2020-11-09
pythonxuexi 2020-11-08
文山羊 2020-11-07
susmote 2020-11-07
wuShiJingZuo 2020-11-05
Pythonjeff远 2020-11-06
jacktangj 2020-11-04
lousir 2020-11-04
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17