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

yipeiwu_com5年前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 解决动态的定义变量名,并给其赋值的方法(大数据处理)

最近消费kafka数据到磁盘的时候遇到了这样的问题: 需求:每天大概有1千万条数据,每条数据包含19个字段信息,需要将数据写到服务器磁盘,以第二个字段作为大类建立目录,第7个字段作为小类...

Python脚本实现下载合并SAE日志

由于一些原因,需要SAE上站点的日志文件,从SAE上只能按天下载,下载下来手动处理比较蛋疼,尤其是数量很大的时候。还好SAE提供了API可以批量获得日志文件下载地址,刚刚写了python...

Python使用修饰器进行异常日志记录操作示例

本文实例讲述了Python使用修饰器进行异常日志记录操作。分享给大家供大家参考,具体如下: 当脚本中需要进行的的相同的异常操作很多的时候,可以用修饰器来简化代码。比如我需要记录抛出的异常...

解决pycharm 远程调试 上传 helpers 卡住的问题

公司开发环境跑在linux上,用了一周都没问题,突然今天无法使用了,具体表现就是一打开pycharm,同步远程解释器就卡在上传helper文件之处,折腾一上午加一中午,用这个方法解决了,...

详解python 字符串和日期之间转换 StringAndDate

python 字符串和日期之间转换 StringAndDate           这里给出实现...