moving python3 to brew and updating

梦想与她 提交于 2019-12-11 02:34:10

问题


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.

  1. How do I uninstall my current python3

  2. 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:

  1. (Optional: use Brew to remove whatever Python it knows about, just to save disk space.)
  2. Follow these macOS installation instructions. My simple summary:
    • brew install pyenv
    • add eval "$(pyenv init -)" to your .zshrc or .bashrc
    • restart your shell
    • pyenv install 3.6.4
    • pyenv global 3.6.4
    • verify that pyenv global prints the version you like.
    • verify that which python and which pip both live in ~/.pyenv/shims/
  3. Use pyenv-managed pip to install your favorite packages globally, like IPython, etc. (Of course, you'll use virtualenv to manage your per-project dependencies right?)
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!