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 按不同维度求和,最值,均值的实例

python 按不同维度求和,最值,均值的实例

当变量维数加大时很难想象是怎样按不同维度求和的,高清楚一个,其他的应该就很清楚了,什么都不说了,上例子,例子一看便明白….. a=range(27) a=np.array(a) a=...

Python Cookie 读取和保存方法

如下所示: #保存 cookie 到变量 import urllib.request import http.cookiejar cookie = http.cookiejar.Co...

基于python解线性矩阵方程(numpy中的matrix类)

这学期有一门运筹学,讲的两大块儿:线性优化和非线性优化问题。在非线性优化问题这里涉及到拉格朗日乘子法,经常要算一些非常变态的线性方程,于是我就想用python求解线性方程。查阅资料的过程...

PyGame贪吃蛇的实现代码示例

PyGame贪吃蛇的实现代码示例

最近帮人做了个贪吃蛇的游戏(交作业用),很简单,界面如下: 开始界面: 游戏中界面: 是不是很简单、朴素。(欢迎大家访问GitHub) 游戏是基于PyGame框架制作的,程序核心逻...

python实现图像识别功能

本文实例为大家分享了python实现图像识别的具体代码,供大家参考,具体内容如下 #! /usr/bin/env python from PIL import Image...