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
于是就有了
commandsList all available pyenv commandslocalSet or show the local application-specific Python versionglobalSet or show the global Python versionshellSet or show the shell-specific Python versioninstallInstall a Python version using python-builduninstallUninstall a specific Python versionrehashRehash pyenv shims (run this after installing executables)versionShow the current Python version and its originversionsList all Python versions available to pyenvwhichDisplay the full path to an executablewhenceList all Python versions that contain the given executable
python需要版本管理么?
或许您还需要下面的文章: