pip upgrade fails with "Successfully installed"
See original GitHub issueDescription
I’ve set a global.target
configuration under C:\ProgramData\pip\pip.ini
[global]
target = C:\Program Files\Python\3.10\pip\site-packages\
Next when attempting an upgrade of pip from v21.2.4 to v21.3.1 no changes will be made despite a Successfully installed pip-21.3.1
message.
Expected behavior
pip install -v --upgrade pip
should either update the current version or display an error message.
pip version
21.2.4
Python version
3.10.1
OS
Windows 11 (OS Build 22000.376)
How to Reproduce
- Install python from “python-3.10.1-amd64.exe”
- Create
pip.ini
underC:\ProgramData\pip\
with the following contents:
[global]
target = C:\Program Files\Python\3.10\pip\site-packages\
- Move the
site-packages
directory to its new location. - Ensure the current user has sufficient acces to the
C:\Program Files\Python\3.10\pip\site-packages\
directory. I’ve given full access to theUser
group - attempt to update pip though the command
pip install -v --upgrade pip
Output
PS C:\Users\Janos> pip config list
global.target='C:\\Program Files\\Python\\3.10\\pip\\site-packages\\'
PS C:\Users\Janos> pip list
Package Version
---------- -------
pip 21.2.4
setuptools 58.1.0
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Program Files\Python\3.10\python.exe -m pip install --upgrade pip' command.
PS C:\Users\Janos> pip show pip
Name: pip
Version: 21.2.4
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig@python.org
License: MIT
Location: c:\program files\python\3.10\lib\site-packages
Requires:
Required-by:
PS C:\Users\Janos> icacls "C:\Program Files\Python\3.10\pip\site-packages"
C:\Program Files\Python\3.10\pip\site-packages BUILTIN\Users:(I)(OI)(CI)(F)
NT SERVICE\TrustedInstaller:(I)(F)
NT SERVICE\TrustedInstaller:(I)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(I)(F)
NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
BUILTIN\Administrators:(I)(F)
BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE)
Hyron-1\Janos:(I)(F)
CREATOR OWNER:(I)(OI)(CI)(IO)(F)
APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(OI)(CI)(IO)(GR,GE)
APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)
APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(OI)(CI)(IO)(GR,GE)
Successfully processed 1 files; Failed processing 0 files
PS C:\Users\Janos> pip install -v --upgrade pip
Using pip 21.2.4 from C:\Program Files\Python\3.10\lib\site-packages\pip (python 3.10)
Collecting pip
Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
Creating C:\Users\Janos\AppData\Local\Temp\pip-target-ox67vwws\bin
Successfully installed pip-21.3.1
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Program Files\Python\3.10\python.exe -m pip install --upgrade pip' command.
PS C:\Users\Janos> pip show pip
Name: pip
Version: 21.2.4
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig@python.org
License: MIT
Location: c:\program files\python\3.10\lib\site-packages
Requires:
Required-by:
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
pip upgrade issue using python -m pip install - Stack Overflow
It seems that if you're not careful when installing/upgrading pip you can inadvertently change it's availability from global to user-specific, ...
Read more >Error while upgrading pip ERROR Could not install packages ...
1: Successfully uninstalled pip-19.1.1 ERROR: Could not install packages due to an EnvironmentError: [Error 5] Access is denied: 'c:\\users\\ ...
Read more >How to Install Pip on Windows - ActiveState
Adding PIP to Windows Environment Variables ... One of the most common problems with running Python tools like pip is the “not on...
Read more >Pip Command Not Found on Windows: A Guide | Built In
A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python...
Read more >Package installation issues | PyCharm Documentation
You might encounter a problem when installing a Python package in the project settings or in the Python Package tool window. Eventually, most...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok figured it out, here’s what it comes down to:
pip install --target \test-path\ pip
will install pip to the target directory:executing
\test-path\bin\pip.exe --version
will then point to the followingThus even though pip-21.3.1 has been installed to the
\test-path\
directory,pip.exe
will point to the original version. Version 21.3.1 exist, under\test-path\pip\__init__.py
Finally, as for the use of
--target
, what I was really looking for is python’s sites, listed bypython -m site
.I assumed I had changed my installation directory to the value set in
C:\ProgramData\pip.ini
, which I did, however python was using the directories listed underpython -m site
which made the update ineffective.I’ll have a look at verifying this issue with a clean installation tomorrow.
It seems that after I deleted the --target parameter I was able to update pip, since then I’ve been unable to reproduce the issue.