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中处理字符串之isalpha()方法的使用

 isalpha()方法检查字符串是否仅由字母组成。 语法 以下是islpha()方法的语法: str.isalpha() 参数   &nb...

Python中使用PDB库调试程序

Python自带的pdb库,发现用pdb来调试程序还是很方便的,当然了,什么远程调试,多线程之类,pdb是搞不定的。 用pdb调试有多种方式可选: 1. 命令行启动目标程序,加上-m参数...

Django中使用 Closure Table 储存无限分级数据

这篇文章给大家介绍Django中使用 Closure Table 储存无限分级数据,具体内容如下所述: 起步 对于数据量大的情况(比如用户之间有邀请链,有点三级分销的意思),就要用到 c...

python 画3维轨迹图并进行比较的实例

python 画3维轨迹图并进行比较的实例

一. 数据的格式 首先我们需要x,y,z三个数据进行画图。从本实验用到的数据集KITTI 00.txt中举例: 1.000000e+00 9.043680e-12 2.326809e...

计算pytorch标准化(Normalize)所需要数据集的均值和方差实例

pytorch做标准化利用transforms.Normalize(mean_vals, std_vals),其中常用数据集的均值方差有: if 'coco' in args.dat...