Ubuntu下利用pyenv管理各Python版本

来源:互联网 发布:吃东西知乎 编辑:程序博客网 时间:2024/06/05 17:12
>> 1
终端输入:$ pyenv,
返回内容:
pyenv 1.1.0Usage: pyenv <command> [<args>]Some useful pyenv commands are:commands    List all available pyenv commandslocal       Set or show the local application-specific Python versionglobal      Set or show the global Python versionshell       Set or show the shell-specific Python versioninstall     Install a Python version using python-builduninstall   Uninstall a specific Python versionrehash      Rehash pyenv shims (run this after installing executables)version     Show the current Python version and its originversions    List all Python versions available to pyenvwhich       Display the full path to an executablewhence      List all Python versions that contain the given executableSee `pyenv help <command>' for information on a specific command.For full documentation, see: https://github.com/pyenv/pyenv#readme

解释:介绍了当前安装的pyenv的版本,一些主要的命令,以及文档的网址。


>> 2
终端输入:$ pyenv versions
返回内容:
 system
* anaconda2-4.4.0 (set by /home/guoyunfei/.pyenv/version)
解释:列出当前系统中安装的所以Python版本。前边带 * 的,表示正在使用的版本。


>> 3
版本切换:pyenv global <想要切换的那个版本名称>,
例如:
$ pyenv global system 
$ pyenv versions
结果:
* system (set by /home/guoyunfei/.pyenv/version)
 anaconda2-4.4.0
注释:会发现当前正在使用的版本切换到了系统默认的版本了。


>> 4
$ pyenv which <版本名称> 会返回该版本的安装位置
$ pyenv which anaconda
/home/guoyunfei/.pyenv/versions/anaconda2-4.4.0/bin/anaconda


原创粉丝点击