Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew install python3 didn't install pip3

I installed python3 using homebrew but it didn't install pip3 or should I say it installed but it doesn't recognize the command ?

Here is what I did:

brew install python3 

This installed python3 but threw an error at the end saying it couldn't link python3 and prompted me to run

brew link python3 

to link the installation but this throws another error:

Linking /usr/local/Cellar/python3/3.6.3... Error: Permission denied @ dir_s_mkdir - /usr/local/lib  

Does anyone know how solve this ? When I run:

brew info python3 

It says:

==> 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: https://docs.brew.sh/Homebrew-and-Python.html 

Which makes me think pip3 is installed but not recognized. Any help is appreciated.

INFO:

OS => MacOS High Sierra 10.13.1

 pip3 install twilio -bash: pip3: command not found 
like image 450
Alexander Luna Avatar asked Nov 13 '17 00:11

Alexander Luna


People also ask

Does python3 install pip3?

Python 3.4+ in most operating systems includes pip3 by default. If your python version is less than 3.4, then you should upgrade your Python version which will automatically install pip3. For example, you can install the latest version of Python from ActiveState (Python 3.9), which includes pip3.

How do I fix pip3 not found?

To Solve sudo: pip3: command not found Error Just use python3 -m pip and this solved my problem. Second solution is Just check pip installed or not with this command pip3 -V If pip is not installed then You would need to install pip3. For Linux Users sudo apt install python3-pip.

How do I install pip3 on Mac?

How could I install pip3 on my Mac? To install or upgrade pip, download get-pip.py from the official site Then run the following command: sudo python get-pip.py and it will install the pip for your python version which runs the script.

How do I know if pip3 is installed on my Mac?

Installing pip on OS X After the program runs, use the command pip --version (or pip3 --version ) to make sure pip was installed correctly.


Video Answer


1 Answers

Ok it took me a lot of googling but the problem is that in high sierra all permissions inside usr/local changed and homebrew has to create some folder inside usr/local. Here is how I solved everything:

I tried using sudo brew install python3 but that also threw an error directly from Homebrew telling me that it doesn't allow the use of sudo brew.

Create the folders I needed using sudo mkdir inside /usr/local:

sudo mkdir lib  sudo mkdir Frameworks 

Change the permissions inside /usr/local so that homebrew can access them:

sudo chown -R $(whoami) $(brew --prefix)/* 

Now install python3

brew install python3 

This will give you a successful installation:

==> Pouring python3-3.6.3.high_sierra.bottle.tar.gz ==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.6.3/bin --in ==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.6.3/bin --in ==> /usr/local/Cellar/python3/3.6.3/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.6.3/bin --in ==> 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: https://docs.brew.sh/Homebrew-and-Python.html ==> Summary 🍺  /usr/local/Cellar/python3/3.6.3: 3,588 files, 56.1MB 
like image 81
Alexander Luna Avatar answered Oct 14 '22 09:10

Alexander Luna