python -m pip install –upgrade pip does not work

Question:

Upgrading pip does not do anything, just tells me to upgrade Pip again and that the requirements are satisfied–however, I am on an old pip version. This is Python27, I get the same issue whether I am in a virtual environment or not.

Output:

C:Python27>python -m pip install --upgrade pip

Requirement already up-to-date: pip in c:python27libsite-packages

You are using pip version 9.0.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Versions Installed:

    $ pip --version
    pip 9.0.1 from c:python27libsite-packages (python 2.7)

    $ pip --version
    pip 9.0.1 from c:usersaroytikhdevflask-tutorialvenvlibsite- 
    packages (python 2.7)
    (venv)
Asked By: Alex

||

Answers:

I think it how to update pip will help you and make sure that you are running command prompt as Administrator. you can do this by right click on the “Command Prompt” application and choose “Run as administrator” and type this command in your command prompt.

    python -m pip install -U pip

try this if it isn’t working for you..

  • Download Pip 19.1.1
  • Install Pip using this command
    $ python -m pip install downloads/pip-19.1.1-py2.py3-none-any.whl

or if it is tar.gz file then

    $ python -m pip install downloads/pip-19.1.1.tar.gz 
Answered By: sai Pavan Kumar

I’m on a Centos 7.9 vm and strugging to get python3 as the default. Erros with yum and so one and cannot get pip upgraded or install modules like results.

Following what you have written here, I got the below errors with pip 22.3.1:

python -m pip install ./pip-22.3.1-py3-none-any.whl
Traceback (most recent call last):
File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/main.py", line 29, in
from pip._internal.cli.main import main as _main
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/_internal/cli/main.py", line 9, in
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/_internal/cli/autocompletion.py", line 10, in
from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/_internal/cli/main_parser.py", line 9, in
from pip._internal.build_env import get_runnable_pip
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/_internal/build_env.py", line 20, in
from pip._internal.cli.spinners import open_spinner
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/_internal/cli/spinners.py", line 9, in
from pip._internal.utils.logging import get_indentation
File "/usr/local/lib/python3.6/site-packages/pip-22.3.1-py3.6.egg/pip/_internal/utils/logging.py", line 8, in
from dataclasses import dataclass
ModuleNotFoundError: No module named ‘dataclasses’

With the current pip 8.1.2 that’s what I get with pip install requests :

Collecting requests
Using cached https://files.pythonhosted.org/packages/9d/ee/391076f5937f0a8cdf5e53b701ffc91753e87b07d66bae4a09aa671897bf/requests-2.28.2.tar.gz
Complete output from command python setup.py egg_info:

==========================
Unsupported Python version
==========================
This version of Requests requires at least Python 3.7, but
you're trying to install it on Python 2.7. To resolve this,
consider upgrading to a supported Python version.

If you can't upgrade your Python version, you'll need to
pin to an older version of Requests (<2.28).

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gUZwWA/requests/
You are using pip version 8.1.2, however version 22.3.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

And with pip install –upgrade pip I get quite the same:

Collecting pip
Using cached https://files.pythonhosted.org/packages/a3/50/c4d2727b99052780aad92c7297465af5fe6eec2dbae490aa9763273ffdc1/pip-22.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-DDD0Gx/pip/setup.py", line 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-DDD0Gx/pip/
You are using pip version 8.1.2, however version 22.3.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

Any1 helping ?

Answered By: TheUnF