11

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.

Pwdr
  • 303
  • 3
  • 12
  • 1
    What about `brew unlink python && brew link python`. If it need use `sudo`. – Serenity Feb 25 '17 at 10:52
  • unlinking reveals that symlinks were present, but `brew link` still fails for the same reason. `sudo` doesn't work at all as Homebrew doesn't like using it: "Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system." – Pwdr Feb 25 '17 at 11:50

4 Answers4

25

Create the Frameworks directory and chown for itself

$ sudo mkdir /usr/local/Frameworks
$ sudo chown -R $(whoami):admin /usr/local/Frameworks
$ brew link python
wgao19
  • 523
  • 5
  • 7
4

I used the command: sudo chown -R "$USER":admin /usr/local courtesy of this answer elsewhere on Stack Overflow.

Pwdr
  • 303
  • 3
  • 12
1

This worked for me:

sudo chown -R $(whoami):admin /usr/local/Cellar/
brew unlink python
brew link python
bak2trak
  • 1,062
  • 8
  • 11
0

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

Community
  • 1
  • 1
Vadim
  • 4,219
  • 1
  • 29
  • 44