简体   繁体   中英

Unable to downgrade python version in macos using Homebrew

Facing issues when trying to downgrade python version from 3.7.3 to 3.6.5_1. I have did lot of research before reaching to stackoverflow family and all of them were suggesting the same resolution steps that i have tried as below, but found no luck. I looking for the python 3.6.5_1 version because Python 3.7 is unsupported by Keras/TensorFlow and thus are not a good choice for OpenCV either:

Option 1:

brew unlink python

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

Error: Calling Installation of python from a GitHub commit URL is disabled! Use 'brew extract python' to stable tap on GitHub instead.

Option 2: brew switch python 3.6.5

Error: python does not have a version "3.6.5" in the Cellar.

after couple of tries I realized that it is problem with the git url that homebrew has it to get python 3.6.5_1 version and that would have changed or the commit url might not be the latest.

macOS version : Catalina 10.15.6

So seeking your guidance and suggestions on how to solve this problem. Also please let me know if missed any info that is required to post here(which could've helped in solving the problem)

Thanks in advance

using brew install sashkab/python/python@3.6 works. credit to @Jean-Pierre Matsumoto.

what has worked for me (of course you can replace 3.7 with any valid python version like 3.5, 3.6, 3.8, 3.9, etc)

brew install python@3.7

and since brew switch is no longer supported you can simply run

brew unlink python3
brew link python@3.7

now you can verify python3 version as desired

python3 --version 

you can use link and unlink in the example above to switch versions and/or to setup virtualenvs with specific python versions

virtualenv --python=python3.7 PATH_TO_NEW_ENV

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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