Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew install python3, but can't link to python3

So I'm trying to install python3 via brew

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

I found this answer, following the steps, but still running into the problem where I can't link python3 and my python -V still shows 2.7

brew install python3 didn't install pip3

like image 743
Leon Gaban Avatar asked Feb 21 '18 14:02

Leon Gaban


People also ask

How do I transition to Python 3 in Terminal Mac?

Open the terminal (bash or zsh) whatever shell you are using. Install python-3 using Homebrew (https://brew.sh). Look where it is installed. Change the default python symlink to the version you want to use from above.

Where does brew install Python Mac?

For brewed Python, modules installed with pip or python3 setup.py install will be installed to the $(brew --prefix)/lib/pythonX. Y/site-packages directory (explained above).


1 Answers

sudo chown -R $(whoami) /usr/local

This will give permission to create the symlinks, hence solving the issue with linking.

like image 92
Prabin Subedi Avatar answered Oct 10 '22 19:10

Prabin Subedi