Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew: Cannot link python

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.

like image 454
Pwdr Avatar asked Feb 25 '17 10:02

Pwdr


Video Answer


3 Answers

Create the Frameworks directory and chown for itself

$ sudo mkdir /usr/local/Frameworks
$ sudo chown -R $(whoami):admin /usr/local/Frameworks
$ brew link python
like image 198
wgao19 Avatar answered Oct 18 '22 21:10

wgao19


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

like image 43
Pwdr Avatar answered Oct 18 '22 21:10

Pwdr


This worked for me:

sudo chown -R $(whoami):admin /usr/local/Cellar/
brew unlink python
brew link python
like image 38
bak2trak Avatar answered Oct 18 '22 23:10

bak2trak