You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pip can output "Successfully installed mypackage-1.0" even if it wasn't successfully installed
pip can leave a .dist-info subdirectory lying around if the installation wasn't successful
Expected behavior
don't log the message "Successfully installed mypackage-1.2.3" unless the installation was actually successful
if the installation was not successful, rollback any metadata files/subdirectory which was written
How to Reproduce
Setup:
$ mkdir /tmp/example
$ python3 -m pip install six==1.14 --target=/tmp/example
Collecting six==1.14
Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six
Successfully installed six-1.14.0
$ ls /tmp/example
__pycache__ six-1.14.0.dist-info six.py
Reproducer:
$ python3 -m pip install six==1.15 --target=/tmp/example
Collecting six==1.15
Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six
Successfully installed six-1.15.0
WARNING: Target directory /tmp/example/__pycache__ already exists. Specify --upgrade to force replacement.
WARNING: Target directory /tmp/example/six.py already exists. Specify --upgrade to force replacement.
$ ls /tmp/example
__pycache__ six-1.14.0.dist-info six-1.15.0.dist-info six.py
$ grep __version__ /tmp/example/six.py
__version__ = "1.14.0"
Output
As you can see, it logged "Successfully installed six-1.15.0" but the code at the target is still the previous version.
Using --upgrade, as the warning message mentioned, does indeed replace files. However, it also leaves files from the old version around too (with six.py there is only one source file, though the old .dist-info subdir also remains). I would normally expect pip to fully remove the previous version before installing new version.
Code of Conduct
I agree to follow the PSF Code of Conduct
The text was updated successfully, but these errors were encountered:
uranusjr
changed the title
pip reports "Successfully installed mypackage-1.0" even though it didn't successfully install
'pip install --target' reports "Successfully installed mypackage-1.0" even though it didn't successfully install
Feb 18, 2021
uranusjr
changed the title
'pip install --target' reports "Successfully installed mypackage-1.0" even though it didn't successfully install
'pip install --upgrade --target' does not uninstall existing installation
Feb 18, 2021
pip version
21.0.1
Python version
3.9
OS
macOS
Additional information
No response
Description
Expected behavior
How to Reproduce
Setup:
Reproducer:
Output
As you can see, it logged "Successfully installed six-1.15.0" but the code at the target is still the previous version.
Using
--upgrade
, as the warning message mentioned, does indeed replace files. However, it also leaves files from the old version around too (withsix.py
there is only one source file, though the old .dist-info subdir also remains). I would normally expect pip to fully remove the previous version before installing new version.Code of Conduct
The text was updated successfully, but these errors were encountered: