linux 下实现python多版本安装实践

yipeiwu_com6年前Python基础

使用pythonbrew

复制代码 代码如下:

easy_install pythonbrew
[root@li637-23 schirm]# pythonbrew_install

Well-done! Congratulations!

The pythonbrew is installed as:

  /root/.pythonbrew

Please add the following line to the end of your ~/.bashrc

  [[ -s "$HOME/.pythonbrew/etc/bashrc" ]] && source "$HOME/.pythonbrew/etc/bashrc"

After that, exit this shell, start a new one, and install some fresh
pythons:

  pythonbrew install 2.7.2
  pythonbrew install 3.2

For further instructions, run:

  pythonbrew help

The default help messages will popup and tell you what to do!

Enjoy pythonbrew at /root/.pythonbrew!!
[root@li637-23 schirm]# vim /root/.pythonbrew
[root@li637-23 schirm]# . ~/.bashrc
[root@li637-23 schirm]# pythonbrew install 2.7.2
Downloading Python-2.7.2.tgz as /root/.pythonbrew/dists/Python-2.7.2.tgz
######################################################################## 100.0%
Extracting Python-2.7.2.tgz into /root/.pythonbrew/build/Python-2.7.2

This could take a while. You can run the following command on another shell to track the status:
  tail -f "/root/.pythonbrew/log/build.log"

Installing Python-2.7.2 into /root/.pythonbrew/pythons/Python-2.7.2

怎么样小伙伴们,是不是很简单,有相同需求的小伙伴们自己参考下吧

相关文章

利用python批量给云主机配置安全组的方法教程

前言 这几年对运维人员来说最大的变化可能就是公有云的出现了,我相信可能很多小伙伴公司业务就跑在公有云上,  因为公司业务关系,我个人接触公有云非常的早,大概在12年左右就是开始...

终端命令查看TensorFlow版本号及路径的方法

终端命令查看TensorFlow版本号及路径的方法

如图,简单易懂,先激活tensorflow,然后进入python,输入python语句执行查询: 需要注意的是一定要在激活tensorflow环境后再输入python命令,否则会识别不...

浅谈python中对于json写入txt文件的编码问题

最近一直在研究python+selenium+beautifulsoup的爬虫,但是存入数据库还有写入txt文件里面的时候一直都是unicode编码的格式。 接下来就是各种翻阅文档,查找...

python实现屏保程序(适用于背单词)

python实现屏保程序(适用于背单词)

今天要给大家分享的是一款自己写的屏保程序,大学大家最头疼的就是四六级的考试了,上次考试做阅读的时候,情不自禁的发呆,想着如果我能在电脑上写一个屏保程序,那么就可以天天记单词了! 开始 首...

python计算一个序列的平均值的方法

本文实例讲述了python计算一个序列的平均值的方法。分享给大家供大家参考。具体如下: def average(seq, total=0.0): num = 0 for...