pyenv 命令

| 选择喜欢的代码风格  

pyenv 命令安装:


-bash/zsh: pyenv: command not found

# Mac OS (Homebrew)
brew update
brew install pyenv

# PyInstaller
https://github.com/pyenv/pyenv-installer

# Dockerfile
 dockerfile.run/pyenv

pyenv 命令补充说明:


pyenv 命令可让用户轻松地在多个 Python 版本之间切换。 使用非常的简单,并且遵循 UNIX 单一用途工具只做好一件事的传统。


pyenv cli

pyenv 项目是从 rbenv 和 ruby-build 分支出来,并针对 Python 进行了修改。

pyenv 命令语法:


pyenv <command> [<args>]

pyenv 命令选项:


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

pyenv 命令实例:


pyenv 列出所有可用命令:

pyenv commands

pyenv 列出 ${PYENV_ROOT}/versions 目录下的所有 Python 版本:

pyenv versions

pyenv 列出上游安装的所有 Python 版本:

pyenv install --list

pyenv 在 ${PYENV_ROOT}/versions 目录下安装 Python 版本:

pyenv install 2.7.10

pyenv 卸载 ${PYENV_ROOT}/versions 目录下的 Python 版本:

pyenv uninstall 2.7.10

pyenv 设置当前机器全局使用的 Python 版本:

pyenv global 2.7.10

pyenv 设置当前目录及其下所有目录使用的 Python 版本:

pyenv local 2.7.10

pyenv 扩展阅读:




发表评论