Solve the pip package error ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot..

Project Scenario and Problem Description

If you use pip to directly install the downloaded specified version of the .whl third-party library in an offline environment, there will be a conflict with the existing installed package version, and an error will be reported: ERROR: Cannot unistall 'llvmlite'.
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.

Take the installation package version llvmlite-0.38.1 as an example, the system already has version 0.31.0.
The details are as follows:

Installing collected packages: llvmlite
	Attempting uninstall: llvmlite
		Found existing installation: llvmlite 0.31.0
ERROR: Cannot unistall 'llvmlite'. 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.

Cause Analysis:

The reason for this kind of problem may be a network problem, which is caused by a failure to connect to a foreign mirror (in this case, you can specify the download address, and the solution will be given at the end of the article). Since my environment is not connected to the Internet, the main problem is version conflicts. Therefore, if you are sure to replace the specified version without affecting the environment that other codes depend on, you can use a violent solution, as follows.


solution:

Adding after the pip command --ignore-installedmeans ignoring the installed library and installing the specified version.
The pip command that caused the error is as follows:

pip install llvmlite-0.38.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

The modified command without error is as follows:

pip install llvmlite-0.38.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl --ignore-installed

The installation is successful after execution:

Processing ./llvmlite-0.38.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Installing collected packages: llvmlite
Successfully installed llvmlite-0.38.1

If it is due to network or foreign mirror connection failure, refer to the following solutions

Various errors are reported when pip installs third-party libraries. It is a distutils installed project and thus we cannot accurately determine

Guess you like

Origin blog.csdn.net/qq_39691492/article/details/130581975
Recommended