Pip install upgrade pip error

Operating System: Debian GNU/Linux 10 (buster) pip version: 20.1.1 Python version: 2.7.16 When i tried to launch this command : sudo docker build -t opencue/rqd -f rqd/Dockerfile . I have this erro...

Hi,

Code is now formated, effectively error occurs on this line :

RUN pip install --upgrade setuptools

The failure stack-trace is actually just

 ---> Running in 651a46936d96
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/25/bf/a37e89d3148221fedd4def62bb68749041d79f3840d58a7943f81a6f6c6e/setuptools-47.1.1.zip (870kB)
    Complete output from command python setup.py egg_info:
    pkg_resources/py2_warn.py:15: UserWarning: Setuptools no longer works on Python 2
    ************************************************************
    Encountered a version of Setuptools that no longer supports
    this version of Python. Please head to
    https://bit.ly/setuptools-py2-sunset for support.
    ************************************************************
      warnings.warn(pre + "*" * 60 + msg + "*" * 60)
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 32 in /tmp/pip-build-i79LHt/setuptools/

The upgrade message is just a suggestion which older pip versions generate so that the user can be notified of upgrading to latest pip, and is not the problem here.

I am not sure which version of python does python-pip contains in the centos:7 image being used by the Dockerfile.

Also looks like RUN pip install --upgrade setuptools is trying to upgrade to setuptools 47.1.1, but according to a URL present in the error message (https://bit.ly/setuptools-py2-sunset), Python 2 support is dropped post setuptools 45.

I tried running the command with the pip I have locally for python 2.7, and the command worked succesfully.

$ python --version
Python 2.7.16

$ pip install --upgrade setuptools
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools
  Using cached setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 44.1.0
    Uninstalling setuptools-44.1.0:
      Successfully uninstalled setuptools-44.1.0
Successfully installed setuptools-44.1.1

So it might have something to with the pip distributed with centos container as well.

Sep-16-2019, 02:10 PM
(This post was last modified: Sep-16-2019, 02:42 PM by metulburr.)

hello dear experts, 

well i have no idea why the python things do not work here. 

the pc. Win 7

the idea: i want to install the newest python and some additional things. 

Python: command “python -m pip install —upgrade pip” doesn’t work

I want to upgrade my pip, but if I type in «python -m pip install —upgrade pip», then my command shell says «cannot find ‘python'». Python is already installed and my command shell can’t detect the command «python», though.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:UsersKasper>pip install esptool
Collecting esptool
  Downloading https://files.pythonhosted.org/packages/6c/bf/578443af2270ebeff78f
dfd30cef3a02433cc63b34a912936653a48526dd/esptool-2.7.tar.gz (83kB)
    100% |████████████████████████████████| 92kB 1.7MB/s
Collecting pyserial>=3.0 (from esptool)
  Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c090
7414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193k
B)/>
    100% |████████████████████████████████| 194kB 4.3MB/s
Collecting pyaes (from esptool)
  Downloading https://files.pythonhosted.org/packages/44/66/2c17bae31c9066137957
11fc78045c285048168919ace2220daa372c7d72/pyaes-1.6.1.tar.gz
Collecting ecdsa (from esptool)
  Downloading https://files.pythonhosted.org/packages/23/a8/8aa68e70959e1287da91
54e5164bb8bd5dd7025e41ae54e8d177b8d165c9/ecdsa-0.13.2-py2.py3-none-any.whl (59kB
)
    100% |████████████████████████████████| 61kB 7.7MB/s
Installing collected packages: pyserial, pyaes, ecdsa, esptool
Could not install packages due to an EnvironmentError: [WinError 5] Zugriff verw
eigert: 'c:\program files\python37\Lib\site-packages\pyserial-3.4.dist-info
'
Consider using the `--user` option or check the permissions.

You are using pip version 10.0.1, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

C:UsersKasper>pip install wxPython
Collecting wxPython
  Downloading https://files.pythonhosted.org/packages/d0/8e/2c72bc3624e5cee50aa9
4f8ae8756bc1c3aec96e8d456b6aa1242e92e9e8/wxPython-4.0.6-cp37-cp37m-win_amd64.whl
 (22.9MB)
    100% |████████████████████████████████| 22.9MB 1.4MB/s
Collecting numpy (from wxPython)
  Downloading https://files.pythonhosted.org/packages/bd/51/7df1a3858ff0465f760b
482514f1292836f8be08d84aba411b48dda72fa9/numpy-1.17.2-cp37-cp37m-win_amd64.whl (
12.8MB)
    100% |████████████████████████████████| 12.8MB 2.5MB/s
Requirement already satisfied: six in c:userskasperappdataroamingpythonpyt
hon37site-packages (from wxPython) (1.12.0)
Collecting pillow (from wxPython)
  Downloading https://files.pythonhosted.org/packages/ae/96/6f83deebfcd20a5d4ad3
5e4e989814a16559d8715741457e670aae1a5a09/Pillow-6.1.0-cp37-cp37m-win_amd64.whl (
2.0MB)
    100% |████████████████████████████████| 2.0MB 6.0MB/s
Installing collected packages: numpy, pillow, wxPython
Could not install packages due to an EnvironmentError: [WinError 5] Zugriff verw
eigert: 'c:\program files\python37\Lib\site-packages\numpy'
Consider using the `--user` option or check the permissions.

You are using pip version 10.0.1, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

C:UsersKasper> -m pip install wxpython
Der Befehl "-m" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

C:UsersKasper> m pip install wxpython
Der Befehl "m" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

C:UsersKasper> pip3 install --upgrade pip
ERROR: To modify pip, please run the following command:
c:program filespython37python.exe -m pip install --upgrade pip
You are using pip version 10.0.1, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

C:UsersKasper>

well i have no glue whats going on here.

Posts: 5,147

Threads: 395

Joined: Sep 2016

Reputation:
170

Sep-16-2019, 02:41 PM
(This post was last modified: Sep-16-2019, 02:41 PM by metulburr.)

it says in the last error message to run this command in which you never did

c:program filespython37python.exe -m pip install --upgrade pip

then run in the command console this to verify you have the new version

pip -V

or full path equivalent

c:program filespython37python.exe -m pip -V

(Sep-16-2019, 02:10 PM)apollo Wrote: I want to upgrade my pip, but if I type in «python -m pip install —upgrade pip», then my command shell says «cannot find ‘python'»

When you installed python did you make sure the box was checked for setting python to the PATH? If not then python and pip will not be recognized unless you use the full path (As the upgrade command i shown agove).

Posts: 6,572

Threads: 116

Joined: Sep 2016

Reputation:
487

Sep-16-2019, 03:11 PM
(This post was last modified: Sep-16-2019, 03:14 PM by snippsat.)

Did you read my answer in your lasted thread?

Quote:[WinError 5] check the permissions

Run cmd as administrator

Again look at Python 3.6/3.7 and pip installation under Windows,it should take short time to fix this.
Then it work like this from any folder,always.

# Upgrade
C:code
λ python -m pip install --upgrade pip
Collecting pip
  Downloading ......
     |████████████████████████████████| 1.4MB 2.2MB/s
Installing collected packages: pip
  Found existing installation: pip 19.2.1
    Uninstalling pip-19.2.1:
      Successfully uninstalled pip-19.2.1
Successfully installed pip-19.2.3

# Test
C:code
λ pip -V
pip 19.2.3 from c:python37libsite-packagespip (python 3.7)

Hey Folks, I received the following warning message:

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

I tried upgrading the pip version with the above-mentioned command:

python -m pip install --upgrade pip

I got the following error:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop
support for Python 2.7.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl (1.4MB)
     |UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU| 1.4MB 437kB/s
Installing collected packages: pip
  Found existing installation: pip 19.1.1
    Uninstalling pip-19.1.1:
      Successfully uninstalled pip-19.1.1
ERROR: Could not install packages due to an EnvironmentError: [Error 5] Access is denied: 'c:\users\kalgi_~1\appdata\local\temp\pip-uninstall-qnu6j7\pip.exe'
Consider using the `--user` option or check the permissions.







Oct 3, 2019


in Python


by



• 18,570 points





15,059 views



1 answer to this question.

As mentioned in the error logs, try using the —user flag to make sure you have the right permissions.

python -m pip install --user --upgrade pip

This should work!






answered

Oct 3, 2019


by
Jason



selected

Dec 3, 2019


by Kalgi


Related Questions In Python

  • All categories

  • ChatGPT
    (4)

  • Apache Kafka
    (84)

  • Apache Spark
    (596)

  • Azure
    (131)

  • Big Data Hadoop
    (1,907)

  • Blockchain
    (1,673)

  • C#
    (141)

  • C++
    (271)

  • Career Counselling
    (1,060)

  • Cloud Computing
    (3,446)

  • Cyber Security & Ethical Hacking
    (147)

  • Data Analytics
    (1,266)

  • Database
    (855)

  • Data Science
    (75)

  • DevOps & Agile
    (3,575)

  • Digital Marketing
    (111)

  • Events & Trending Topics
    (28)

  • IoT (Internet of Things)
    (387)

  • Java
    (1,247)

  • Kotlin
    (8)

  • Linux Administration
    (389)

  • Machine Learning
    (337)

  • MicroStrategy
    (6)

  • PMP
    (423)

  • Power BI
    (516)

  • Python
    (3,188)

  • RPA
    (650)

  • SalesForce
    (92)

  • Selenium
    (1,569)

  • Software Testing
    (56)

  • Tableau
    (608)

  • Talend
    (73)

  • TypeSript
    (124)

  • Web Development
    (3,002)

  • Ask us Anything!
    (66)

  • Others
    (1,938)

  • Mobile Development
    (263)

Subscribe to our Newsletter, and get personalized recommendations.

Already have an account? Sign in.

pip Command Not Found – Mac and Linux Error Solved

When using Python, you might need to install and use certain packages. And there is a command available for that known as ‘pip’.

With pip, you can install, upgrade, and uninstall various Python packages. You’ll learn how to use it, and how to handle pip errors, in this article.

How to use pip

Pip is a command that you can use on the Linux or Mac command line. You can select a package from here.

Below is an example of how you would install the mock-open package with pip.

pip3 install mock-open

Output:

image

As this package was already installed, we are getting the message that the requirement is already met.

Note that I have used pip3 because I am using Python3. We’ll discuss this in detail later.

What is the error pip: command not found?

Sometimes when you are installing packages, you might face the error: pip: command not found. This error could be due to the following reasons:

  1. Pip is not installed.
  2. Pip is installed, but it is not compatible with the current environment.

On Linux, you must install the pip package manager separately as it is an independent package. But on Mac, you do not need to install pip manually, as long as you are working with Python 3.x.

Troubleshooting the error pip: command not found

  1. Check if pip is installed.

On Mac and Linux, you can use the below command to check if pip is installed.

 python3 -m pip --version 

pip installed

Here’s the output if pip is installed correctly

If pip is not installed, you can follow the install steps here for your respective OS.

2. Upgrade pip to the latest version

If pip is still not working, try to upgrade pip to the latest version:

python -m pip install --upgrade pip

Output after upgrading pip

Output after upgrading pip

3. Fix environment issues

It is possible that you are trying to use the wrong version of pip. For example, pip3 works for Python3, whereas pip works only for Python2.

You can check your Python version on Linux and Mac like this:

image-3

I am using Python3

If your code is in Python 2 and you still wish to use an older version of pip, you can follow the below steps.

Note that Python 2 has reached end of life. It is better to upgrade your code base to Python 3 and use the latest version of pip.

Follow the below steps only if you are using Python2:

  1. Install pip (older version)
sudo easy_install pip

This command installs the pip command onto your system.

Now try to use the pip command – it should work without errors.

Wrapping up

Pip is a useful command to install Python packages. We have covered some troubleshooting methods for the error pip: command not found.

I hope you found this tutorial helpful.

Let’s connect on Twitter!

You can read my other posts here.



Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Понравилась статья? Поделить с друзьями:
  • Pip install torch error
  • Pioneer mvh s520bt ошибка 23
  • Pip install tensorflow error
  • Pioneer mvh pioneer amp error
  • Pioneer mvh a200vbt error 10