Python3没有安装

时间:2017-03-05 23:06:01

标签: python-3.x

当我运行$ brew install 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。请指教。

1 个答案:

答案 0 :(得分:3)

我能够解决问题,引用以下issue

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