Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing/uninstalling my module with pip

I am going through the Learn Python the Hard Way, 2nd Edition book, and I am stuck on this problem: "Use your setup.py to install your own module and make sure it works, then use pip to uninstall it."
If I type

setup.py install 

in the command line, I can install the module.

But when I type

pip uninstall setup.py 

it says:

Cannot uninstall requirement setup.py, not installed 

The pip package index says, http://pypi.python.org/pypi/pip, says:

pip is able to uninstall most installed packages with pip uninstall package-name.

Known exceptions include pure-distutils packages installed with python setup.py install >(such packages leave behind no metadata allowing determination of what files were >installed)

Is there another way to install my module that pip will recognize?

By the way, I'm using a windows computer. Just wanted to mention that in case there are different solutions for Windows, Linux, and Mac.

like image 521
Eva Avatar asked Jul 08 '11 14:07

Eva


People also ask

Can you uninstall packages with pip?

Packages can be uninstalled from a virtual environment using pip or pipenv.

How do I uninstall pip and install again?

Run command prompt as administrator. Give the command easy_install -m pip. This may not uninstall pip completely. So again give this command pip uninstall pip If by previous command pip got uninstalled then this command wont run, else it will completely remove pip.


1 Answers

You're giving pip a Python file and not a package name, so it doesn't know what to do. If you want pip to remove it, try providing the name of the package this setup.py file is actually part of.

There are some good suggestions in this related thread: python setup.py uninstall

like image 130
kungphu Avatar answered Oct 05 '22 21:10

kungphu