Uninstall pip dependency with a hyphen at the start of it's name

I accidentally globally installed a package called -igalixir with pip3. When I try to uninstall it with pip3 uninstall -igalixir it interprets -igalixir as a command line option. I have tried surrounding it with quotes which also doesn't work.

The output of pip3 list and pip3 freeze are as follows:

$ pip3 list
Package Version
---------- -------
-igalixir 1.0.19
click 6.7
pip 19.0.3
proxy.py 0.3
Pygments 2.2.0
requests 2.13.0
rollbar 0.13.18
setuptools 40.8.0
six 1.12.0
stripe 1.51.0
wheel 0.33.1
$ pip3 freeze
Could not parse requirement: -igalixir
click==6.7
proxy.py==0.3
Pygments==2.2.0
requests==2.13.0
rollbar==0.13.18
six==1.12.0
stripe==1.51.0

I'm not even sure how I installed it in the first place if it is an invalid package name. Is there anyway to cleanly purge this from my system. I don't want any random files hanging around my system - so I prefer if it uninstalled properly.

EDIT

I tried to separate the -igialixir term with --, like so: pip3 uninstall -- -igalixir, and although it does not interpret -igialixar as a command line option any more, it still doesn't accept it because it is an invalid requirement.

$ pip3 uninstall -- -igalixir
Invalid requirement: '-igalixir'
3

2 Answers

Quotes are interpreted and stripped by the shell, pip doesn't even receive them.

The standard way to deal with such cases in GNU utilities is to use the double dash:

sometool -somearg -otherarg -- -these -are -interpreted -as -file -names

I guess pip may use this convention too.

1

I ran into a similar situation. What worked for me was to run the following command to see where the installation resides:

pip show -- -pkgname

I then went to that folder and simply removed the offending folder (it was listed with a hyphen but the folder name started with a tilde sign, ~pkgname).

That solved the issue in my case.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like