Mac OS上安装gevent的时候遇到点麻烦,看到网上有这样的东西,先看看python homebrew
,值得注意的是这个包已经不再维护
了。
pythonbrew
安装 pythonbrew
curl -kL http://xrl.us/pythonbrewinstall | bash
再把下面这个添加到~/.bash_profile
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
有意思的是在我的~/.bash_profile
里面还有一个
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
pythonbrew用法
- 列出可安装的 python 版本:
pythonbrew list --know
- 安装某个版本的 python :
pythonbrew install 2.7.3
- 删除已安装的某版本的 python :
pythonbrew uninstall 2.7.3
- 列出已安装的 python 版本(当前使用的版本后会用星号标记):
pythonbrew list
- 。。。
就不再copy了,这是一个不再维护的包。上面推荐了一个pyenv
Mac OS pyenv
安装pyenv
用的自然是brew
brew update
brew install pyenv
问题是python的版本会有ruby那么混乱么?
pyenv用法
试试
pyenv --help
于是就有了
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 executable
python需要版本管理么?
或许您还需要下面的文章: