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中list循环语句用法实例

本文实例讲述了python中list循环语句用法。分享给大家供大家参考。具体用法分析如下: Python 的强大特性之一就是其对 list 的解析,它提供一种紧凑的方法,可以通过对 li...

解决pycharm运行出错,代码正确结果不显示的问题

解决pycharm运行出错,代码正确结果不显示的问题

昨天手贱,觉得自己装的Python版本太低,重新安装了一个,安装完成后运行出现错误: Fatal Python error: initfsencoding: unable to load...

python实现切割url得到域名、协议、主机名等各个字段的例子

有一个需求就是需要对url进行进一步的划分得到详细的各个字段信息,下面是简单的实现: #!/usr/bin/python # -*- coding: UTF-8 -*- ''' __...

Python使用matplotlib 模块scatter方法画散点图示例

Python使用matplotlib 模块scatter方法画散点图示例

本文实例讲述了Python使用matplotlib 模块scatter方法画散点图。分享给大家供大家参考,具体如下: # -*-coding:utf-8-*- import matp...

Python实现的二维码生成小软件

Python实现的二维码生成小软件

前几天,我估摸着做一个能生成QR Code小程序,并能用wxPython在屏幕上显示出来。当然,我想用纯Python实现,观望了一会后,我找到了三个候选: github 上的 pytho...