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

2

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'

Llew Vallis

Posted 2019-05-20T08:23:56.270

Reputation: 21

I was going to suggest using pip's internal API to call it from a Python program, but it's not really supported. Why not install a dummy package, then uninstall with -v and check the paths, then manually repeat the deletion commands with your faulty package?

– slhck – 2019-05-20T09:28:48.097

I'm having same issue. Any luck with this? – rekans – 2019-11-01T23:23:47.020

@rekans I'm afraid not, my solution was to reinstall pip3 IIRC. – Llew Vallis – 2019-11-04T09:29:53.017

Answers

0

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.

gronostaj

Posted 2019-05-20T08:23:56.270

Reputation: 33 047

Good idea, but unfortunately didn't have any luck with it. – Llew Vallis – 2019-05-20T08:47:56.340