2017-03-05 160 views
0

當我運行$ brew install python3我收到以下錯誤:Python3不安裝

==> Downloading https://homebrew.bintray.com/bottles/python3-3.6.0_1.sierra.bottle.tar.gz 
... 
copying build/lib/pkg_resources/__init__.py -> /usr/local/lib/python3.6/site-packages/pkg_resources 
error: could not create '/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py': Permission denied 
Warning: The post-install step did not complete successfully 
You can try again using `brew postinstall python3` 
==> Caveats 
Pip, setuptools, and wheel have been installed. To update them 
    pip3 install --upgrade pip setuptools wheel 

You can install Python packages with 
    pip3 install <package> 

They will install into the site-package directory 
    /usr/local/lib/python3.6/site-packages 

See: http://docs.brew.sh/Homebrew-and-Python.html 
==> Summary 
    /usr/local/Cellar/python3/3.6.0_1: 3,259 files, 51.3M 

安裝停止在error: could not create '/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py': Permission denied Warning: The post-install step did not complete successfully

當我運行$ brew postinstall python3,我得到了同樣的錯誤:

==> Using the sandbox 
... 
running install_lib 
copying build/lib/easy_install.py -> /usr/local/lib/python3.6/site-packages 
copying build/lib/pkg_resources/__init__.py -> /usr/local/lib/python3.6/site-packages/pkg_resources 
error: could not create '/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py': Permission denied 

READ THIS: http://docs.brew.sh/Troubleshooting.html 

此錯誤阻止我輸入python3

我正在運行macOS Sierra。請指教。

+0

是什麼'釀造doctor'的意見呢? '/ usr/local /'的權限是多少? (即'ls -ld/usr/local'的輸出?) – eddies

回答

1

我是能夠解決的問題,參考下面issue

cd /usr/local/lib/python3.6/site-packages 
sudo chown -R <username> ./*