[英]brew install python3, but can't link to python3
所以我試圖通過brew
安裝python3
==> Downloading https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
Already downloaded: /Users/leongaban/Library/Caches/Homebrew/python3-3.6.4.tar.xz
==> ./configure --prefix=/usr/local/Cellar/python3/3.6.4_2 --enable-ipv6 --datarootdir=/usr/local/Cellar/python3/3.6.4_2/shar
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python3/3.6.4_2
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python3/3.6.4_2/share/python3
==> Downloading https://files.pythonhosted.org/packages/a4/c8/9a7a47f683d54d83f648d37c3e180317f80dc126a304c45dc6663246233a/se
Already downloaded: /Users/leongaban/Library/Caches/Homebrew/python3--setuptools-36.5.0.zip
==> Downloading https://files.pythonhosted.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pi
Already downloaded: /Users/leongaban/Library/Caches/Homebrew/python3--pip-9.0.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/fa/b4/f9886517624a4dcb81a1d766f68034344b7565db69f13d52697222daeb72/wh
Already downloaded: /Users/leongaban/Library/Caches/Homebrew/python3--wheel-0.30.0.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
➜ ~ python -V
Python 2.7.10
➜ ~ brew link python3
Linking /usr/local/Cellar/python3/3.6.4_2... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
我按照步驟找到了這個答案,但仍然遇到了無法鏈接 python3 並且我的python -V
仍然顯示2.7
sudo chown -R $(whoami) /usr/local
這將允許創建符號鏈接,從而解決鏈接問題。
啊! 我剛剛修復了它,我在/usr/local/lib
創建了 Frameworks 文件夾,而不僅僅是/usr/local/
移動文件夾並重新運行后sudo chown -R $(whoami) $(brew --prefix)/*
我可以創建brew link python3
我正在從@lucas 復制評論以提高知名度。 這對我有用。
sudo mkdir /usr/local/Frameworks
sudo chown -R $(whoami) /usr/local/Frameworks
brew link
命令以完成符號鏈接。brew link python3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.