Python is broken somehow after running a script that rewrites files. I get the error anytime I use it:
$ python
-bash: /usr/local/bin/python: No such file or directory
I did brew doctor:
$ brew unlink python && brew link python
Yesterday I tried to fix it by reinstalling:
$ brew update
$ brew install python
$ brew upgrade python
Based on what I found it seems like I need to symlink it but I don't want to make it worse and lose the entire OS.
$ which python
/usr/bin/python
How can I fix this Python?
Something seems to go haywire with Homebrew 1.7.2 and MacOS 10.13.6.
Even after removing all python versions and reinstalling, python --version
simply won't work.
Most have probably already tried these steps...
brew uninstall --ignore-dependencies python
brew uninstall --ignore-dependencies python2
brew uninstall --ignore-dependencies python3
brew install python
brew unlink python && brew link python
brew unlink python3 && brew link python3
At the end what worked for me was...
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python
And then again for pip...
sudo ln -s /usr/local/bin/pip3 /usr/local/bin/pip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With