I'm currently working on a Mac with Mojave. I have successfully installed python 3.7 with brew
brew install python3
But I have tried several methods to install pip for python 3.7 (installing with get-pip.py, easy_install pip, etc.), which had worked for installing pip in the python 2.7 folder, but not in the python 3.7.
Currently when I call
pip --version
I get
pip 18.1 from /Library/Python/2.7/site-packages/pip (python 2.7)
And pip3 seems not to exist.
How can I get pip3 installed in the python 3.7 folder? Thanks!
Install Python 3 with the Official Installer First, download an installer package from the Python website. To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac.
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.
Sometimes when you are installing packages, you might face the error: pip: command not found . This error could be due to the following reasons: Pip is not installed. Pip is installed, but it is not compatible with the current environment.
To install PIP using ensurepip:Open the Mac Terminal app via the Launchpad. In the Terminal, type python -m ensurepip or python3 -m ensurepip and press Enter. If PIP is missing, ensurepip will install PIP. Follow any additional on-screen instructions to complete this process.
If you want to ensure pip installed for python 3.7, try something like this:
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.7 get-pip.py
Ok, so I still don't quite understand what's going on with pip3 in my device, but I found a way to install packages with pip in the right Python version:
python3 -m pip install [package]
It worked to install numpy which was my primary objective.
Maybe you're using an older version of Brew?
In that case run brew postinstall python3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With