Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing matplotlib using pip RHEL getting error "Cannot uninstall 'pyparsing' "

I am currently using RHEL7 and am trying to install matplotlib. When ever i have attempted to do

python -m pip install -U matplotlib

or

pip install matplotlib

I get the error message "Cannot uninstall 'pyparsing'. 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."

Any help would be greatly appreciated, and if you need more information I can provide it.

like image 858
Giddswindle Avatar asked Oct 11 '25 13:10

Giddswindle


1 Answers

The problem is that pip cannot properly uninstall packages installed by "pure" distutils (see the details here).

You can fix the problem by deleting pyparsing by hands:

Firstly, you need to determine the path to the package:

$ pip list -v | grep pyparsing

You will see something like:

pyparsing           2.0.1              /path_to_the_python/site-packages

Then take this path and delete the package (mind the asterisk):

$ rm -rf  /path_to_the_python/site-packages/pyparsing*

And install it again:

$ pip install pyparsing
like image 127
Yury Kirienko Avatar answered Oct 14 '25 09:10

Yury Kirienko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!