slavakurilyak
slavakurilyak

Reputation: 101

Python3 Not Installing

When I run $ brew install python3 I get the following error:

==> 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

The installation stops at 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

When I run $ brew postinstall python3, I get the same error:

==> 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

This error prevents me from typing python3

I'm running macOS Sierra. Please advise.

Upvotes: 0

Views: 906

Answers (1)

slavakurilyak
slavakurilyak

Reputation: 101

I was able to solve the problem, referencing the following issue

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

Upvotes: 3

Related Questions