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

yipeiwu_com6年前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

怎么样小伙伴们,是不是很简单,有相同需求的小伙伴们自己参考下吧

相关文章

Django学习笔记之ORM基础教程

Django学习笔记之ORM基础教程

ORM简介 ORM概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术。 简单的说,OR...

Python最长公共子串算法实例

本文实例讲述了Python最长公共子串算法。分享给大家供大家参考。具体如下: #!/usr/bin/env python # find an LCS (Longest Common...

Python实现简易端口扫描器代码实例

Python实现简易端口扫描器代码实例

在网上的一些资料的基础上自己又添了些新内容,算是Python socket编程练手吧。 #coding=utf-8 import socket import time import...

Python设计模式之建造者模式实例详解

Python设计模式之建造者模式实例详解

本文实例讲述了Python设计模式之建造者模式。分享给大家供大家参考,具体如下: 建造者模式(Builder Pattern):将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以...

在Python中定义一个常量的方法

大家都知道,网络上流行这么一句话 如果一个程序,JAVA需要写1000行,那PHP要写500行,而Python只要写200行就可以拉~~ 那么在Python中,如何用代码去实现一个常量呢...