how do I upgrade pip on Mac? - python-3.x

I cannot upgrade pip on my Mac from the Terminal.
According to the documentation I have to type the command:
pip install -U pip
I get the error message in the Terminal:
pip: command not found
I have Mac OS 10.14.2, python 3.7.2 and pip 18.1.
I want to upgrade to pip 19.2.3

upgrading pip as of 09/2020:
pip3 install --upgrade pip==20.2.2

pip3 install --upgrade pip
this works for me!

Try this
pip install --upgrade pip==19.2.3
Hope this will help you.

I have found an answer that worked for me:
sudo pip3 install -U pip --ignore-installed pip
This installed pip version 19.2.3 correctly.
It was very hard to find the correct command on the internet...glad I can share it now.
Thanks.

If you want to upgrade to the latest pip version (as of this writing pip-21.2.4) and you are using mac, do the following:
Open your terminal, on your main folder and type:
$ pip3 -V
This will give you the version you have installed
Then type:
$ pip3 install --upgrade pip
Or
$ sudo pip3 install --upgrade pip
The latest if you need to input your password

try:
sudo -H pip3 install --upgrade pip

I came on here to figure out the same thing but none of this things seemed to work. so I went back and looked how they were telling me to upgrade it but I still did not get it. So I just started trying things and next thing you know I seen the downloading lines and it told me that my pip was upgraded. what I used was (pip3 install -- upgrade pip). I hope this can help anyone else in need.

Make sure you have pip installed in the first place. Refer to https://pip.pypa.io/en/stable/installing/ to install pip.

For MAC with M1 :
pip3 install --upgrade pip
If you want to install specific version:
pip3 install --upgrade pip==21.1.1
After pip == version_number should be entered
If you want to know more about pip commands:
pip3 help

Related

Upgrading to pip version 19.3.1

doesn't work I want to upgrade pip version from 19.2.3 to 19.3.1 but couldn't able to do that. I had tried the command so many times but that doesn't resolve the problem.
got another problem admin mode
user mode
How about running in administrator cmd mode?
https://www.youtube.com/watch?v=5MY4PY4LoXM
Or you can add the --user option
python -m pip install --upgrade pip --user

unable to upgrade pip version 10.0.1 to 18.0 in cmd

I'm trying to upgrade pip but the below command didn't worked out. Currently, I have pip version 10.0.1 and I want to upgrade it to 18.0
command I tried in cmd:
python -m pip install --upgrade pip
It's showing:
Attribute Error:module 're' has no attribute 'findall'
There might be something wrong with your pip instalation
try this:
curl bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
My problem is with my version of pip 9.0, upgrading always fails (I run a MacBook with OSX 10.7.5) showing similar message like this example , If any one had an idea...:
$ python -m pip install --upgrade pip
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages
But every time I use pip install, is this:
$ pip install lxml
Collecting lxml
Could not fetch URL https://pypi.python.org/simple/lxml/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement lxml (from versions: )
No matching distribution found for lxml
Make sure you have exited python and you are back in main Anaconda terminal. Press
exit
to leave python and then run this code
python -m pip install --upgrade pip
or run the commands below;
conda config --add channels conda-forge
conda update pip
If you are in windows and using virtual env then use
(virtual env) c/path>easy_install -U pip
this will update pip inside the virtual env and if you do it outside of virtual env then it should also work there as well.
this will update pip 18.0 in virtual env and if you do it outside of virtual env then it should also work there as well.
python -m pip install --upgrade pip 18.0

Unable to install beautifulsoup4 in python on Mac Os

I am trying to install beautifulsoup4 in my mac using the following command:
pip3 install beautifulsoup4
But I am getting this following error:
Could not find a version that satisfies the requirement beautifulsoup4 (from versions: )
No matching distribution found for beautifulsoup4
How can I solve this?
Update pip with pip3 install --upgrade pip. Now you should be able to install beautifulsoup pip3 install beautifulsoup4. If that fails try: python3 -m pip install beautifulsoup4
If you’re using a recent version of Debian or Ubuntu Linux, you can install Beautiful Soup with the system package manager:
$ apt-get install python-bs4 (for Python 2)
$ apt-get install python3-bs4 (for Python 3)
Or
you can install it with easy_install or pip.
$ easy_install beautifulsoup4
$ pip install beautifulsoup4
If you are using Anaconda distribution, you can use this command.
conda install -c anaconda beautiful-soup
Hope this helps.
I tried upgrading pip3 with what Jatmir was suggesting, but it did not work for me. Finally, I found another way to upgrade it in this post https://github.com/pypa/pip/issues/5255#issuecomment-381702613
curl https://bootstrap.pypa.io/get-pip.py | python3
I had the same issue with my MacBook and I did below.(2018/September)
Update pip with
pip3 install --upgrade pip
Now you should be able to install beautifulsoup
pip3 install beautifulsoup4
If that fails try:
python3 -m pip install beautifulsoup4
You can download the tarball from here.
extract it, then run:
sudo python setup.py install
if pip fails to work

Setting the 'correct' pip3

I have Python 2.7 installed (by default) and also a Python3.x. I installed anaconda later. When I use pip3, it uses the pip3 for Python3.x I guess. When I do which pip3 on terminal, it shows user/bin/pip3. But I want it to use pip3 from anaconda. How do I go about doing that?
Try this in the Anaconda prompt:
conda install pip3
If that doesn't work, in the same prompt try
pip install pip3

Issue installing shapely Python Package

I am running python 3.6 on windows and am attempting to install Shapely using
pip install shapely==1.6b2
It is giving me the following errors
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Cameron\AppData\Local\Temp\pip-build-242ae_ih\shapely\
I have seen the other posts about this issue and have tried:
pip install --upgrade setuptools
pip install ez_setup
easy_install -U setuptools
Nothing seems to work and I am not sure what to do next. Any advice would be appreciated.
Thanks
You may try to use the binary from this unofficial site. Just use pip install {wheel file name} to install it.
Shapely‑1.5.17‑cp36‑cp36m‑win32.whl (32-bit)
Shapely‑1.5.17‑cp36‑cp36m‑win_amd64.whl (64-bit)
Hope this would make the installation easier.
I had a similar error for installing shapely-1.5.17 via pip install shapely, and installing this made the pip install command work thereafter:
sudo apt-get install libgeos-dev
As of 2020, you can now simply install Shapely for Windows with:
pip install shapely
(you many need --upgrade to get at least version 1.7.0, when binary wheels were added for Windows)

Resources