简体   繁体   English

Mac 用 brew 安装 python3.6

[英]Mac install python3.6 with brew

I want to install python version 3.6.我想安装 python 3.6 版。 when I do brew install python it installs latest version of python ie 3.8 .当我执行brew install python它会安装最新版本的 python 即3.8

I tried below solution but it is giving me error.我尝试了以下解决方案,但它给了我错误。

brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

Error:错误:

Error: Calling Installation of python from a GitHub commit URL is disabled!错误:从 GitHub 提交 URL 调用安装 python 被禁用! Use 'brew extract python' to stable tap on GitHub instead.使用 'brew extract python' 来稳定点击 GitHub。

I even tried solution in this link but not working.我什至在此链接中尝试了解决方案,但没有奏效。

Also When I do:当我这样做时:

brew search python

I don't find python@3.6 init我没有找到python@3.6 init

Maybe you should do pyenv to manage the different python versions.也许你应该做pyenv来管理不同的 python 版本。

brew install pyenv
pyenv install 3.6.5
pyenv install 3.7.4

If you want to control the shell to use different python versions, you can try this:如果你想控制shell使用不同的python版本,你可以试试这个:

pyenv shell 3.6.5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM