6

How can I resolve the following error?

When trying to install pipenv on Alpine:

pip3 install pipenv

I get the following error:

Installing collected packages: distlib, virtualenv, pipenv
  Attempting uninstall: distlib
    Found existing installation: distlib 0.3.0
ERROR: Cannot uninstall 'distlib'. 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.

Python version: 3.8.3
pip3 version: 20.2.2
Alpine version: 3.12 (Linux 5.4.43-1-virt #2-Alpine SMP Thu, 28 May 2020 20:13:48 UTC x86_64 Linux)

Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
  • 1
    Does this answer your question? [pip cannot uninstall : "It is a distutils installed project"](https://stackoverflow.com/questions/53807511/pip-cannot-uninstall-package-it-is-a-distutils-installed-project) – phd Aug 21 '20 at 05:46
  • https://stackoverflow.com/search?q=%5Bpip%5D+ERROR%3A+Cannot+uninstall+a+distutils+installed+project+and+thus+we+cannot+accurately+determine+which+files+belong+to+it+which+would+lead+to+only+a+partial+uninstall – phd Aug 21 '20 at 05:46

1 Answers1

13

Install using the --ignore-installed distlib option to pip3:

pip3 install --ignore-installed distlib pipenv
#            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125