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 OpenCV对本地视频文件进行分帧保存的实例

如下所示: # coding=utf-8 import os import cv2 videos_src_path = "/home/wgp/视频/" video_forma...

python实现求最长回文子串长度

给定一个字符串,求它最长的回文子串长度,例如输入字符串'35534321',它的最长回文子串是'3553',所以返回4。 最容易想到的办法是枚举出所有的子串,然后一一判断是否为回文串,返...

Pandas库之DataFrame使用的学习笔记

Pandas库之DataFrame使用的学习笔记

1 简介 DataFrame是Python中Pandas库中的一种数据结构,它类似excel,是一种二维表。 或许说它可能有点像matlab的矩阵,但是matlab的矩阵只能放数值型值(...

35个Python编程小技巧

这篇博客其实就是这个集合整理后一部分的公开亮相。如果你已经是个python大牛,那么基本上你应该知道这里面的大多数用法了,但我想你应该也能发现一些你不知道的新技巧。而如果你之前是一个c,...

轻松实现TensorFlow微信跳一跳的AI

轻松实现TensorFlow微信跳一跳的AI

作为python和机器学习的初学者,目睹了AI玩游戏的各种风骚操作,心里也是跃跃欲试。 然后发现微信跳一跳很符合需求,因为它不需要处理连续画面(截屏太慢了)和复杂的操作,很适合拿来练手。...