1

I am installing the following python module

pip install ipaddress-1.0.23-py2.py3-none-any.whl

the pip failed on

Processing ipaddress-1.0.23-py2.py3-none-any.whl
Installing collected packages: ipaddress
  Attempting uninstall: ipaddress
    Found existing installation: ipaddress 1.0.16
ERROR: Cannot uninstall 'ipaddress'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

What isn’t clear here why pip trying to uninstall the current pkg - ipaddress 1.0.16

As all can see we not using the option --force-reinstall

So why pip install is removing the current - ipaddress 1.0.16 ?

Reference - Difference between pip install options "ignore-installed" and "force-reinstall"

jessica
  • 2,172
  • 13
  • 41
  • What `pip` version do you use? – hoefling Jun 22 '20 at 17:25
  • 21 version , after upgrade from 8 – jessica Jun 22 '20 at 17:26
  • 1
    You are installing from a wheel file directly, this is effectively the same as saying `pip install ipaddress==1.0.23`. The currently installed version of `ipaddress` doesn't match this requirement, so `pip` tries to uninstall that, giving you the famous error of being unable to uninstall an "old and unmanageable" package. You can either loosen the requirement by issuing `pip install ipaddress --find-links=.` (assuming `.` contains the wheel file), this will install nothing. Or downgrade `pip` to 9.0, uninstall `ipaddress` and reinstall the new version from wheel. – hoefling Jun 22 '20 at 17:38
  • now , i used the option - --ignore-installed , and its installed successfully , do you have any remarks about this? – jessica Jun 22 '20 at 17:56
  • The same thoughts as in the linked answer - `--ignore-installed` doesn't uninstall, only overwrite files. Depending on how `ipaddress` was installed before, you may still have remainings of 1.0.16 lying around in the site. Try `pip uninstall -y ipaddress` and then `pip show ipaddress`, what do you get? – hoefling Jun 22 '20 at 18:04
  • sorry for delay , I not near the machine , so I will update , just want to know if you think that option - --ignore-installed is good enough ? – jessica Jun 22 '20 at 20:57
  • No, it's not good enough. – hoefling Jun 23 '20 at 13:51

1 Answers1

1

Try to run:

sudo pip install ipaddress==1.0.23 --ignore-installed
Tomerikoo
  • 15,737
  • 15
  • 35
  • 52
Angellaugh
  • 19
  • 4