Home >Backend Development >Python Tutorial >How to uninstall a module in Python
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!