2

If I clone a repos that uses setuptools, I can install it using python3 setup.py install --user.

For example:

git clone https://github.com/pybliometrics-dev/pybliometrics
cd pybliometrics
python3 setup.py install --user

However, I cannot pip uninstall it anymore. In fact:

$ pip3 uninstall pybliometrics
Found existing installation: pybliometrics 3.2.1.dev2
Can't uninstall 'pybliometrics'. No files were found to uninstall.

I have to change directory for the uninstallation command to be successful. Then change directory back if I want to reinstall it.

Why is that?

How can I uninstall from the same folder that I used to install it?

Here is the output of pip show as asked in the comment:

$ pip show -f pybliometrics
Name: pybliometrics
Version: 3.2.1.dev2
Summary: Python-based API-Wrapper to access Scopus
Home-page: https://pybliometrics.readthedocs.io/en/stable/
Author: 'John Kitchin and Michael E. Rose
Author-email: [email protected]
License: MIT
Location: /run/media/MYNAME/MYID/data/progetti_miei/pybliometrics
Requires: pbr, requests, simplejson, tqdm
Required-by: 
Files:
Cannot locate RECORD or installed-files.txt
8
  • Can you add the output of pip show -f XXX to the question? Commented Jan 9, 2022 at 18:42
  • Maybe the egg info in the local dir prevents pip from seeing the installed package - try removing XXX.egg-info dir from the project dir, then try uninstalling again. Commented Jan 9, 2022 at 18:44
  • @hoefling I have added the output of pip show Commented Jan 18, 2022 at 15:06
  • @hoefling there is no egg-info in the project dir Commented Jan 18, 2022 at 15:06
  • Cannot locate RECORD or installed-files.txt seems to indicate why it can not be uninstalled. For the installation, you should have used python -m pip install --user . instead of python setup.py install --user. Commented Jan 19, 2022 at 8:57

1 Answer 1

1
+50

In the output of the pip show -f pybliometrics command, we can read:

Files:
Cannot locate RECORD or installed-files.txt

This might explain why it can not be uninstalled. And I am not sure how this happened, nor how to fix it.

But with that said, here are some notes:

  1. The commands shown in your question are inconsistent. On one hand you call pip show -f pybliometrics and on the other you call pip3 uninstall pybliometrics. But pip and pip3 are not necessarily the same thing, and do not necessarily interact with the same projects.

  2. Do not use python setup.py install. Calling the setup.py is now deprecated, the recommended way of installing a Python project is via pip.

  3. One should never call the pip scripts directly, but should always prefer explicitly calling the pip executable module with the targeted Python interpreter (see this reference article and this other answer for details).

So in your case what you probably should have done (no guarantee it would have solved your issue, but it would have minimized risks):

  • Clearly identify which Python interpreter you want to use, let's say it is path/to/bin/pythonX.Y
  • Install project with: path/to/bin/pythonX.Y -m pip install --user path/to/pybliometrics
  • Check installed project with path/to/bin/pythonX.Y -m pip show -f pybliometrics
  • Uninstall project with: path/to/bin/pythonX.Y -m pip uninstall pybliometrics
Sign up to request clarification or add additional context in comments.

1 Comment

That was it. I have to install with path/to/bin/pythonX.Y -m pip install --user path/to/pybliometrics. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.