Last modified: Jun 21, 2025 By Alexander Williams

How to Uninstall BeautifulSoup (bs4) in Python

BeautifulSoup (bs4) is a popular Python library for web scraping. Sometimes, you may need to uninstall it. This guide will help you remove it cleanly.

Why Uninstall BeautifulSoup?

You might need to uninstall BeautifulSoup for several reasons. Maybe you want to upgrade it or switch to another library. Or, you might be cleaning your Python environment.

Whatever the reason, uninstalling it is simple. Follow the steps below.

Check if BeautifulSoup is Installed

Before uninstalling, check if BeautifulSoup is installed. Use the pip show command.

 
pip show beautifulsoup4


Name: beautifulsoup4
Version: 4.12.0
Summary: Screen-scraping library
Location: /usr/local/lib/python3.9/site-packages

If installed, you will see details like above. If not, you will see a "not found" message.

Uninstall BeautifulSoup Using pip

The easiest way to uninstall BeautifulSoup is using pip uninstall.

 
pip uninstall beautifulsoup4


Found existing installation: beautifulsoup4 4.12.0
Uninstalling beautifulsoup4-4.12.0:
  Would remove:
    /usr/local/lib/python3.9/site-packages/beautifulsoup4-4.12.0.dist-info/*
    /usr/local/lib/python3.9/site-packages/bs4/*
Proceed (y/n)? y
  Successfully uninstalled beautifulsoup4-4.12.0

Confirm the uninstallation by typing y. This will remove BeautifulSoup from your system.

Verify the Uninstallation

After uninstalling, verify it is removed. Use the pip show command again.

 
pip show beautifulsoup4


WARNING: Package(s) not found: beautifulsoup4

If you see this message, BeautifulSoup is successfully uninstalled.

Manual Removal (Optional)

Sometimes, files may remain. You can manually delete them. Check the installation location.

 
pip show beautifulsoup4 | grep Location


Location: /usr/local/lib/python3.9/site-packages

Navigate to the location and delete the bs4 folder and related files.

Reinstall BeautifulSoup (Optional)

If you need BeautifulSoup again, reinstall it easily.

 
pip install beautifulsoup4

This will install the latest version. For more details, check the How to Uninstall Requests in Python guide.

Common Issues and Fixes

Sometimes, uninstallation may fail. Here are common fixes.

Permission Denied: Run the command with sudo on Linux/Mac.

 
sudo pip uninstall beautifulsoup4

Multiple Python Versions: Ensure you are using the correct pip. Use pip3 for Python 3.

For more help, refer to the How to Uninstall Flask in Python guide.

Conclusion

Uninstalling BeautifulSoup (bs4) is straightforward. Use pip uninstall and verify the removal. For other libraries, check guides like How to Uninstall Django in Python.

Keep your Python environment clean. Happy coding!