brew installing one, specific formula (not cask) and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/Homebrew/caskroom/homebrew-cask/newbrew update and retried your prior step?brew doctor, fixed all issues and retried your prior step?brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link? → https://gist.github.com/2d81c14cff1d05eca64966ba46ecdb3cPlease note we will close your issue without comment if you delete or do not fill out the issue checklist and provide ALL the requested information.
To help us debug your issue please explain:
After a recent brew upgrade, the Python virtualenvwrapper.sh started giving errors. It said python cannot find virtualenvwrapper module. I was trying to fix this error message.
Then I did a bit debugging and realized it started using the macOS system python (/usr/bin/python) after a while. No matter how many times I reinstalled python formula, I still did not get a /usr/local/bin/python symlink:
$ brew unlink python && brew link python -v
Unlinking /usr/local/Cellar/python/2.7.13_1... 32 symlinks removed
Linking /usr/local/Cellar/python/2.7.13_1...
ln -s ../Cellar/python/2.7.13_1/bin/2to3-2 2to3-2
ln -s ../Cellar/python/2.7.13_1/bin/2to3-2.7 2to3-2.7
ln -s ../Cellar/python/2.7.13_1/bin/easy_install easy_install
ln -s ../Cellar/python/2.7.13_1/bin/easy_install-2.7 easy_install-2.7
ln -s ../Cellar/python/2.7.13_1/bin/idle2 idle2
ln -s ../Cellar/python/2.7.13_1/bin/idle2.7 idle2.7
ln -s ../Cellar/python/2.7.13_1/bin/pip pip
ln -s ../Cellar/python/2.7.13_1/bin/pip2 pip2
ln -s ../Cellar/python/2.7.13_1/bin/pip2.7 pip2.7
ln -s ../Cellar/python/2.7.13_1/bin/pydoc2 pydoc2
ln -s ../Cellar/python/2.7.13_1/bin/pydoc2.7 pydoc2.7
ln -s ../Cellar/python/2.7.13_1/bin/python2 python2
ln -s ../Cellar/python/2.7.13_1/bin/python2-config python2-config
ln -s ../Cellar/python/2.7.13_1/bin/python2.7 python2.7
ln -s ../Cellar/python/2.7.13_1/bin/python2.7-config python2.7-config
ln -s ../Cellar/python/2.7.13_1/bin/pythonw2 pythonw2
ln -s ../Cellar/python/2.7.13_1/bin/pythonw2.7 pythonw2.7
ln -s ../Cellar/python/2.7.13_1/bin/smtpd2.7.py smtpd2.7.py
ln -s ../Cellar/python/2.7.13_1/bin/smtpd2.py smtpd2.py
ln -s ../Cellar/python/2.7.13_1/bin/wheel wheel
ln -s ../../../Cellar/python/2.7.13_1/share/man/man1/python.1 python.1
ln -s ../../../Cellar/python/2.7.13_1/share/man/man1/python2.1 python2.1
ln -s ../../../Cellar/python/2.7.13_1/share/man/man1/python2.7.1 python2.7.1
ln -s ../Cellar/python/2.7.13_1/share/python python
ln -s ../../Cellar/python/2.7.13_1/lib/pkgconfig/python-2.7.pc python-2.7.pc
ln -s ../../Cellar/python/2.7.13_1/lib/pkgconfig/python.pc python.pc
ln -s ../../Cellar/python/2.7.13_1/lib/pkgconfig/python2.pc python2.pc
ln -s ../../Cellar/python/2.7.13_1/Frameworks/Python.framework/Headers Headers
ln -s ../../Cellar/python/2.7.13_1/Frameworks/Python.framework/Python Python
ln -s ../../Cellar/python/2.7.13_1/Frameworks/Python.framework/Resources Resources
ln -s ../../../Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7 2.7
ln -s ../../../Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/Current Current
32 symlinks created
To have a symlink at /usr/local/bin/python after installing python formula so that it replaces my system Python.
brew install commands)brew install pythonstat /usr/local/bin/python → does not exist.See https://github.com/Homebrew/homebrew-core/pull/14408 & the significant discussion there.
Also the caveats at the end of the python installation:
==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.zshrc:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
Pip and setuptools have been installed. To update them
pip2 install --upgrade pip setuptools
You can install Python packages with
pip2 install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: http://docs.brew.sh/Homebrew-and-Python.html
I am still having this issue.
After installing python with brew, there is no symlink /usr/local/bin/python
@marisveide python@2 creates /usr/local/bin/python. python creates /usr/local/bin/python3.
Thanks, @ilovezfs!
I ended up creating symbolic links for python and pip manyally.
Most helpful comment
Also the caveats at the end of the
pythoninstallation: