pip thinks it needs to be updated when it does not - python

My installation of pip seems to be convinced it is out of date:
$ sudo pip install editable .
<my stuff gets installed>
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ pip --version
pip 8.1.2 from /home/wash/.local/lib/python2.7/site-packages (python 2.7)
$ python --version
Python 2.7.11+
I am running Debian 8.0. I've tried running pip install --upgrade pip as it has requested.

Related

pip is showing that its upgraded but it's not?

I am trying to install pygame on my pc but the process was getting finished by exit code -1. So some people recommended to upgrade it (my old one was 7.1.0) After upgrading, I am still seeing 7.1.0
Command:
pip install --upgrade pip
What I got
You are using pip version 7.1.0, however version 21.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
Collecting pip
Using cached https://files.pythonhosted.org/packages/ac/cf/0cc542fc93de2f3b9b5
3cb979c7d1118cffb93204afb46299a9f858e113f/pip-21.1-py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-7.1.0
So I mean that pip is still stuck at 7.1.0 instead it should have jumped to the latest??*
Now when i try to see pip version by typing:
pip --version
it returns
pip 7.1.0 from c:\python34\lib\site-packages\pip-7.1.0-py3.4.egg (python 3.4)
Run the following command:
$ python -m pip install --upgrade pip

How to change pip version on google cloud

mistakenly first i installed python 3.6 then install pip,then i install python 3.8 after that i checked the pip version its shows me.
pip 20.1.1 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
Can i change to
pip 20.1.1 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)
If you want to ensure pip is using the python version you desire, you can use:
python3.8 -m pip ...
instead of the bare:
pip ...
The following should work:
$ python3.8 -m pip install pip
$ python3.6 -m pip uninstall pip

pip install --upgrade pip isnt upgrading pip

I'm trying to upgrade pip on Centos 7. I pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7) installed.
When I run pip install --upgrade pip --user I get the following output:
Collecting pip
Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.2
You are using pip version 8.1.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
What I've tried
I've tried the following, which have all resulted in the same output and result as above:
pip install --upgrade pip --user
pip install -U pip --user --ignore-installed
pip install -U pip --user --ignore-installed --no-cache-dir
sudo yum update pip which returns
No Match for argument: pip
No package pip available.
No packages marked for update
sudo yum update python-pip which returns No packages marked for update
Observations
python -m pip --version outputs:
pip 19.3.1 from /home/deploy/.local/lib/python2.7/site-packages/pip (python 2.7)
pip --version outputs:
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
You need to update your PATH to include /home/deploy/.local/lib/python2.7/bin before /usr/lib/python2.7/bin if you want pip to resolve to the same location as python. Otherwise, python -m pip is the more proper usage pattern
Otherwise, you're looking at two completely separate python installations and pip is indeed upgraded in one of them
Note: Python2 is end of life, so probably best to remove the one in your home folder, anyway, and switch to using something like Pipenv or pyenv

Failed to upgrade pip3 on Mac with Homebrew Python

I failed at upgrading pip3 on mac and get confusing (for me) answers in the terminal:
> which python
/usr/bin/python
> pip -V
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)
> which python3
/usr/local/bin/python3
> python3 -V
Python 3.6.4
> pip3 -V
pip 7.1.0 from /usr/local/lib/python3.6/site-packages (python 3.6)
> sudo -H pip3 install --upgrade pip
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages
> sudo -H pip3 install --upgrade pip3
Could not find a version that satisfies the requirement pip3 (from versions: )
No matching distribution found for pip3
Why can't I have pip3 upgraded to 9.0?
Solution was to force reinstall:
sudo -H pip3 install --upgrade pip --force-reinstall
Verify that /usr/local/bin/pip3 --version is 9.0.1. If not:
sudo python3 -m pip install --upgrade pip
I.e., use pip package from that particular Python version.

How to upgrade pip3?

I want to use python3.5 for development, but many times when I install the module for python 3.5, it always fails. The terminal tells me that a higher version is available, but it doesn't work when I upgrade it.
You are using pip3 to install flask-script which is associated with python 3.5. However, you are trying to upgrade pip associated with the python 2.7, try running pip3 install --upgrade pip.
It might be a good idea to take some time and read about virtual environments in Python. It isn't a best practice to install all of your packages to the base python installation. This would be a good start: http://docs.python-guide.org/en/latest/dev/virtualenvs/
To upgrade your pip3, try running:
sudo -H pip3 install --upgrade pip
Your pip may move from /bin to /usr/local/bin
To upgrade pip as well, you can follow it by:
sudo -H pip2 install --upgrade pip
Try this command:
pip3 install --upgrade setuptools pip
First decide which pip you want to upgrade, i.e. just pip or pip3.
Mostly it'll be pip3 because pip is used by the system, so I won't recommend upgrading pip.
The difference between pip and pip3 is that
NOTE: I'm referring to PIP that is at the BEGINNING of the command
line.
pip is used by python version 2, i.e. python2
and
pip3 is used by python version 3, i.e. python3
For upgrading pip3: # This will upgrade python3 pip.
pip3 install --upgrade pip
For upgrading pip: # This will upgrade python2 pip.
pip install --upgrade pip
This will upgrade your existing pip to the latest version.
The Problem
You use pip (the Python 2 one). Now you want to upgrade pip (the Python 3 one). After that, pip is the Python 3 one.
The solution
Use pip2 and pip3. This way it is explicit.
If you want to use pip, just check where it is (which pip) and change the link. For example:
$ which pip
/usr/local/bin/pip
$ pip --version
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
$ which pip2
/usr/local/bin/pip2
$ sudo rm /usr/local/bin/pip
$ sudo ln -s /usr/local/bin/pip2 /usr/local/bin/pip
$ pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
for Python 3:
python3 -m pip install --upgrade pip
for Python 2:
python2 -m pip install --upgrade pip
What worked for me was the following command:
python -m pip install --upgrade pip
pip3 install --upgrade pip worked for me
In Ubuntu 18.04, below are the steps that I followed.
python3 -m pip install --upgrade pip
For some reason you will be getting an error, and that be fixed by making bash forget the wrongly referenced locations using the following command.
hash -r pip
If you have 2 versions of Python (eg: 2.7.x and 3.6), you need do:
add the path of 2.x to system PATH
add the path of 3.x to system PATH
pip3 install --upgrade pip setuptools wheel
for example, in my .zshrc file:
export PATH=/usr/local/Cellar/python#2/2.7.15/bin:/usr/local/Cellar/python/3.6.5/bin:$PATH
You can exec command pip --version and pip3 --version check the pip from the special version. Because if don't add Python path to $PATH, and exec pip3 install --upgrade pip setuptools wheel, your pip will be changed to pip from python3, but the pip should from python2.x
This worked for me (mac)
sudo curl https://bootstrap.pypa.io/get-pip.py | python
If you try to run
sudo -H pip3 install --upgrade pip3
you will get the following error:
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
but if you upgrade using the suggested command:
pip install --upgrade pip
then, the legacy pip will be upgraded, so what I did is the following:
which pip3
and I located my pip3 installation (just in case the following command wouldn't upgrade the legacy pip. Then i changed to that directory and upgraded pip3 using the following commands: (your directory could be different)
cd /Library/Frameworks/Python.framework/Versions/3.8/bin
sudo -H pip3 install --upgrade pip
after this:
pip --version
will still show the legacy version, while
pip3 --version
will show pip 21.0.1

Categories