Rob Bednark
Rob Bednark

Reputation: 28222

Why does "pip3 install pipenv" give error: ERROR: Cannot uninstall 'distlib'?

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)

Upvotes: 6

Views: 3156

Answers (1)

Rob Bednark
Rob Bednark

Reputation: 28222

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

pip3 install --ignore-installed distlib pipenv
#            ^^^^^^^^^^^^^^^^^^^^^^^^^^

Upvotes: 13

Related Questions