“ pip3 install pipenv”给出错误:错误:无法卸载'distlib'

问题描述

如何解决以下错误

尝试在Alpine上安装pipenv时:

pip3 install pipenv

我收到以下错误

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版本:3.8.3
pip3版本:20.2.2
高山版本:3.12(Linux 5.4.43-1-virt#2-Alpine SMP Thu,2020年5月28日20:13:48 UTC x86_64 Linux)

解决方法

使用--ignore-installed distlib的{​​{1}}选项进行安装:

pip3