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中映射类型的内建函数和工厂函数

1.基本函数介绍 (1)标准类型函数[type()、str()和 cmp()]         对一个字典调用typ...

python获取外网ip地址的方法总结

本文实例总结了python获取外网ip地址的方法。分享给大家供大家参考。具体如下: 一、利用脚本引擎库直接获取 import console; import web.script i...

Python对接支付宝支付自实现功能

代码如下所示: # -*- coding: utf-8 -*- import base64 import json import urllib.parse from datetime...

Python解决两个整数相除只得到整数部分的实例

在python中进行两个整数相除的时候,在默认情况下都是只能够得到整数的值 解决方法: 1. 修改被除数的值为带小数点的形式即可得到浮点值 2.在文件头部引入 from __futu...

numpy.transpose对三维数组的转置方法

如下所示: import numpy as np 三维数组 arr1 = np.arange(16).reshape((2, 2, 4)) #[[[ 0 1 2 3] #...