Last modified: Jun 21, 2025 By Alexander Williams
How to Uninstall Selenium in Python
Selenium is a popular tool for web automation. Sometimes, you may need to uninstall it. This guide will show you how.
Table Of Contents
Why Uninstall Selenium?
You might want to uninstall Selenium to free up space or resolve conflicts. It's also useful when switching to other tools like Requests.
Check If Selenium Is Installed
First, verify if Selenium is installed. Use the pip show
command.
pip show selenium
If installed, you'll see details like version and location.
Uninstall Selenium Using Pip
Use the pip uninstall
command to remove Selenium.
pip uninstall selenium
Confirm the action by typing y when prompted.
Verify Uninstallation
Check again with pip show
to ensure Selenium is gone.
pip show selenium
If uninstalled, you'll see a "not found" message.
Clean Up Dependencies
Selenium may have dependencies. Use pip autoremove
to clean them.
pip autoremove selenium
This removes unused packages. Be careful as it might affect other projects.
Alternative Methods
If pip fails, try manual deletion. Locate the package and delete it.
For virtual environments, deactivate and delete the env. Recreate it without Selenium.
Reinstall Selenium If Needed
To reinstall, use pip install selenium
. This is useful for testing.
pip install selenium
Check out Flask uninstall guide for similar steps.
Common Issues
Permission errors may occur. Use sudo
on Linux or run as admin on Windows.
If issues persist, check Django uninstall guide for more tips.
Conclusion
Uninstalling Selenium is simple with pip. Always verify the removal and clean up dependencies. This keeps your Python environment tidy.