问题
I am running osx 10.11.6 (el-capitan) a long time ago I installed Python3 using the download on python.org (3.5.0) since then I've installed brew and would like to use brew to manage python3 instead. I have to upgrade to python3.6 because I'm getting the tlsv1 alert protocol version error.
How do I uninstall my current python3
How do I get brew to install python 3.6 (it seems to only want to install 3.5.1)
or is it better to just run different python versions beside one another?
Thanks!
回答1:
Short answer: pyenv is the absolute best!
Longer answer:
- (Optional: use Brew to remove whatever Python it knows about, just to save disk space.)
- Follow these macOS installation instructions. My simple summary:
brew install pyenv- add
eval "$(pyenv init -)"to your.zshrcor.bashrc - restart your shell
pyenv install 3.6.4pyenv global 3.6.4- verify that
pyenv globalprints the version you like. - verify that
which pythonandwhich pipboth live in~/.pyenv/shims/
- Use pyenv-managed
pipto install your favorite packages globally, like IPython, etc. (Of course, you'll use virtualenv to manage your per-project dependencies right?) - Happy Pythoning 🐍! 😁
In addition to being able to have multiple pythons installed and a global default configured, you can even have per-directory overrides!
Summary: pyenv + virtualenv = the good life.
来源:https://stackoverflow.com/questions/49911259/moving-python3-to-brew-and-updating