码迷,mamicode.com
首页 > 编程语言 > 详细

多版本python管理pyenv

时间:2014-07-17 23:22:39      阅读:348      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   使用   os   io   

pyenv安装: https://github.com/yyuu/pyenv#choosing-the-python-version

pyenv命令: https://github.com/yyuu/pyenv/blob/master/COMMANDS.md

pyenv virtualenv插件安装: https://github.com/yyuu/pyenv-virtualenv

pyenv commands

Lists all available pyenv commands.

不同python版本间的切换使用

pyenv version

Displays the currently active Python version, along with information on how it was set.

pyenv versions

Lists all Python versions known to pyenv, and shows an asterisk next to the currently active version.

pyenv which

Displays the full path to the executable that pyenv will invoke when you run the given command.

$ pyenv which python3.3
/home/yyuu/.pyenv/versions/3.3.3/bin/python3.3

pyenv rehash

Installs shims for all Python binaries known to pyenv (i.e., ~/.pyenv/versions/*/bin/*). Run this command after you install a new version of Python, or install a package that provides binaries.

$ pyenv rehash
 

1、查看可以安装的版本

pyenv install -l

2、安装python2.7.8

pyenv install 2.7.8 

如果失败参考: https://github.com/yyuu/pyenv/wiki/Common-build-problems

3、创建一个使用指定版本python虚拟环境(注意:python-version必须是pyenv安装的版本)

pyenv virtualenv python-version virtual-env-name

4、创建一个使用当前python版本的虚拟环境

pyenv virtualenv virtual-env-name

5、激活虚拟环境(注意这个虚拟环境必须是pyenv创建的)

pyenv activate virtual-env-name

6、退出虚拟环境

pyenv deactivate 

7 、显示已存在的虚拟环境

pyenv virtualenvs

多版本python管理pyenv,布布扣,bubuko.com

多版本python管理pyenv

标签:des   style   http   使用   os   io   

原文地址:http://www.cnblogs.com/zxpo/p/3851396.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!