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

How to uninstall a module in Python

高洛峰
Release: 2017-03-03 14:55:47
Original
1199 people have browsed it

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
Copy after login

Then get rid of them:

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

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
Copy after login

Delete the specified module or package

pip uninstall xxx
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template