Gabriel Gabriel - 2 months ago 10
Python Question

Can't remove python package

I'm trying to remove a package I apparently installed sometime ago (can't remember really) and I'm finding it harder than I thought it would be (the package's name is

astropy
).

If I do:

import pip
inst_packgs = pip.get_installed_distributions()
inst_packgs_lst = ["%s" % (i.key) for i in inst_packgs]
print inst_packgs_lst


the package is listed as installed.

but if I try:

pip list


the package is not listed as installed.

If I do:

pip search astropy


the package is listed as an available package in PyPi.

If I try:

pip uninstall astropy


I get:

Cannot uninstall requirement astropy, not installed
Storing debug log for failure in /home/gabriel/.pip/pip.log


Why is this not working? How should I remove this package from my system?




UPDATE

pyenv
is installed in my system and it was set to a different version locally, which is why the package didn't show. Sorry everybody, this question should be closed/deleted.

Answer

Answering my own question for completeness sake.

pyenv was installed in my system and it was set to a different version locally, which is why the package didn't show.