问题
I'm having an issue linking python in Homebrew. Here is the output:
brew link python
Linking /usr/local/Cellar/python/2.7.13... Error: Permission denied - /usr/local/Frameworks
When I ls -al
on the contents of /usr/local (to see the permissions of Frameworks), I find there is no directory 'Frameworks'.
I'm hesitant to mkdir Frameworks
in case it does so with the wrong permissions and doesn't connect it to other elements of the system.
回答1:
Create the Frameworks
directory and chown
for itself
$ sudo mkdir /usr/local/Frameworks
$ sudo chown -R $(whoami):admin /usr/local/Frameworks
$ brew link python
回答2:
I used the command: sudo chown -R "$USER":admin /usr/local
courtesy of this answer elsewhere on Stack Overflow.
回答3:
This worked for me:
sudo chown -R $(whoami):admin /usr/local/Cellar/
brew unlink python
brew link python
回答4:
as an alternative you can use pip
How do I install pip on macOS or OS X?
Also, anaconda package is great
https://www.continuum.io/downloads
来源:https://stackoverflow.com/questions/42454926/homebrew-cannot-link-python