码迷,mamicode.com
首页 > 其他好文 > 详细

pyenv安装

时间:2017-09-04 22:39:19      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:安装   pts   dev   ssl   set   ready   exe   evel   查看   

pyenv安装

https://github.com/pyenv/pyenv,这里是github的地址,pyenv是一个类似virtualenv的工具,提供python的多版本环境控制

安装依赖环境(root用户):

yum -y install make gcc patch gdbm-devel openssl-devel sqlite-devel zlib-devel bzip2-devel readline-devel

安装pyenv(普通用户):

$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$ echo export PYENV_ROOT="$HOME/.pyenv" >> ~/.bash_profile
$ echo export PATH="$PYENV_ROOT/bin:$PATH" >> ~/.bash_profile
$ echo eval "$(pyenv init -)" >> ~/.bash_profile
$ exec "$SHELL"

查看支持的python版本:

$ pyenv install --list

安装具体的某个版本:

[ocean@jenkins ~]$ pyenv install 3.6.2
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
Installing Python-3.6.2...
Installed Python-3.6.2 to /home/ocean/.pyenv/versions/3.6.2
[root@jenkins ~]# pyenv install 3.5.2
pyenv: /root/.pyenv/versions/3.5.2 already exists
continue with installation? (y/N) y
Downloading Python-3.5.2.tar.xz...
-> https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
Installing Python-3.5.2...
patching file Lib/venv/scripts/posix/activate.fish
Installed Python-3.5.2 to /root/.pyenv/versions/3.5.2

 

查看安装的python版本:

[ocean@jenkins ~]$ pyenv versions
* system (set by /home/ocean/.pyenv/version)
  3.6.2

 

ok,简单使用可以查看帮助:

[ocean@jenkins ~]$ pyenv help
Usage: pyenv <command> [<args>]

Some useful pyenv commands are:
   commands    List all available pyenv commands
   local       Set or show the local application-specific Python version
   global      Set or show the global Python version
   shell       Set or show the shell-specific Python version
   install     Install a Python version using python-build
   uninstall   Uninstall a specific Python version
   rehash      Rehash pyenv shims (run this after installing executables)
   version     Show the current Python version and its origin
   versions    List all Python versions available to pyenv
   which       Display the full path to an executable
   whence      List all Python versions that contain the given executable

See `pyenv help <command> for information on a specific command.
For full documentation, see: https://github.com/pyenv/pyenv#readme

 

pyenv安装

标签:安装   pts   dev   ssl   set   ready   exe   evel   查看   

原文地址:http://www.cnblogs.com/ocean-boy/p/7475922.html

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