1、下载python

# wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz

2、解压、编译安装

# 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/python27
 
4、使用
python27 helloworld.py
# 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/python27
 
4、使用
python27 helloworld.py

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-07-24
  • 2021-12-27
猜你喜欢
  • 2019-07-02
  • 2021-12-03
  • 2021-08-23
  • 2021-12-14
  • 2022-12-23
  • 2021-07-04
  • 2021-12-22
相关资源
相似解决方案