Is cleanup needed after failed pip install?

I accidentally installed pip using the following commands:

$ curl -o
$ python
Collecting pip
  Downloading (1.4MB)
     |████████████████████████████████| 1.4MB 1.3MB/s
Collecting setuptools
  Downloading (576kB)
     |████████████████████████████████| 583kB 7.5MB/s
Collecting wheel
Installing collected packages: pip, setuptools, wheel
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/nix/store/96p42644i76jqgdkxjgyl3f0c8n8k16j-python3-3.7.4/lib/python3.7/site-packages/pip'

The installation failed. Is there anything I have to cleanup?

What distro/OS are you using? That process can sometimes have issues if you’re on a OS that includes a preinstalled version of Python. In those cases, I would recommend checking the official repository it uses to see if there’s a python3-pip or similar package to install pip through (if it’s not already installed).

Usually no.


I’m on nixos and have python installed through it.

However I don’t need pip at all for the moment. I just want to make sure some files aren’t left somewhere.

To be a bit more elaborate:

Since the installation failed to even create the first directory, there shouldn’t be anything installed on the system by the script you’ve run. The script could have saved some files in a ~/.cache, but looking at the output, it didn’t cache anything. pip does cleanup after itself pretty well (eg. even deleting temporary directories it makes before exiting).

So… no, I don’t think there’s anything for you to do here manually.

Thanks for reaching out and checking in with us over here! ^>^


So I checked ~/.cache and found the pip directory. I deleted it and rerun python

The script failed again (like it did initially) and again I was left with ~/.cache/pip. So does indeed leave some files though I wouldn’t consider this a problem since ~/.cache is a folder that people are allowed to remove.

Thank you very much for the help