Homebrew: Cannot link python

╄→гoц情女王★ 提交于 2021-02-07 05:27:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!