pip uninstall: "No files were found to uninstall."

I have created a python module, call it 'foo_bar'.

I can install it and I can upgrade it, but I cannot uninstall it.

I build my module using bdist_wheel:

$ python3 setup.py bdist_wheel 

And I install and upgrade it as follows:

$ python3 -m pip --timeout 60 install --upgrade dist/foo_bar-1.4.3-py3-none-any.whl 

It is listed within Python 3.4 framework directory:

ls -al /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ drwxr-xr-x 12 samwise admin 408 Jun 21 02:50 foo_bar drwxr-xr-x 9 samwise admin 306 Jun 21 02:50 foo_bar-1.4.3.dist-info 

And it listed within pip freeze:

$ python3 -m pip freeze foo-bar==1.4.3 

However, if I try to perform pip uninstall, it cannot find it's files

$ python3 -m pip uninstall foo-bar Can't uninstall 'foo-bar'. No files were found to uninstall. 

Did I do something wrong within my setup.py for it not to be able to find my modules files during uninstall?

Version info is as follows:

$ python3 --version Python 3.4.4 $ python3 -m pip --version pip 8.1.2 from /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages (python 3.4) 
5

4 Answers

I had the same issue. Using verbose helped me to find out a bit more the reason:

$ pip3 uninstall --verbose my-homemade-package Not sure how to uninstall: my-homemade-package e48e635 - Check: /home/olivier/my-homemade-package Can't uninstall 'my-homemade-package'. No files were found to uninstall. 

Removing everything that was 'my-homemade-package' related in /usr/local/python2.x and /usr/local/python3.x did not help.

I did a pip3 show my-homemade-package and got the location of the installed package on my computer:

$ pip3 show my-homemade-package Name: my-homemade-package Version: e48e635 Summary: My Home Made package Home-page: UNKNOWN Author: UNKNOWN Author-email: UNKNOWN License: Proprietary Location: /home/olivier/my-homemade-package Requires: pyOpenSSL, pyasn1, protobuf 

Removing /home/olivier/my-homemade-package sorted it out the issue (ie: the package was not listed).

1

This is an old post, but it was top result in Google. The above answers are correct, however, in my case there was still line /usr/local/lib/python3.6/site-packages/easy-install.pth that I had to remove after also removing the egg files.

1

So I was having a similar issue to OP. I could install my package with pip install dist/mypackage.tar.gz. Installation would work fine, but at the end it would show Can't uninstall 'mypackage'. No files were found to uninstall., and indeed pip uninstall mypackage wouldn't work later on.

It sounds silly but what worked for me was to change working directory: once I left mypackage/ directory, pip uninstall mypackage worked.

1

I had such issue when I renamed my module in setup.py.

Old old_name.egg-info directory still existed in my_module directory. So, when I installed module with pip install -e . pip created a line in python3.8/site-packages/easy-install.pth pointing to module directory. After that module was listed by pip list with both names: new-name and old-name. And when I tried to remove old module with pip remove old-name pip showed error:

Found existing installation: old-name 0.3.0 Can't uninstall 'old-name'. No files were found to uninstall. 

The solution was to remove directory old_name.egg-info from module directory. After that pip list shows only new-name.

Probably it is not direct answer to original post but one of the solutions for issue in topic-name.

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoanBxZGaCc3%2BOqaCpZaWjtq%2B%2F05qjpWWepHqntcueqmavlaeybrLOrqWdZaSkera6yKeqrZmcoQ%3D%3D