Home >Backend Development >Python Tutorial >How to uninstall a module in Python

How to uninstall a module in Python

高洛峰
高洛峰Original
2017-03-03 14:55:471182browse

easy_install uninstall

Modules installed through easy_install can be uninstalled directly through easy_install -m PackageName, and then delete the egg in the Python27Libsite-packages directory.

setup.py To uninstall

modules installed through the setup.py included in the distribution package, the uninstall option provided by setup.py is preferred. If the author does not provide the uninstall option, uninstall manually through the following command line:

First get the files generated during the installation process:

python setup.py install --record record.txt

Then get rid of them:

FOR /F "delims=" %f in (record.txt) DO del "%f"

After that you can go to Python27Libsite-packages Check whether any empty directories remain.

Use pip

Install pip

$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py

Delete the specified module or package

pip uninstall xxx

I think it is better to use easy_install to install it, which is more convenient to uninstall.

For more articles related to how to uninstall modules in Python, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn