Last modified: Jun 23, 2025 By Alexander Williams

How to Uninstall PyPDF2 in Python

PyPDF2 is a popular Python library for working with PDF files. Sometimes, you may need to uninstall it. This guide will show you how.

Why Uninstall PyPDF2?

You might want to uninstall PyPDF2 for several reasons. Maybe you no longer need it. Or you want to install a different version. It could also be causing conflicts.

Whatever the reason, uninstalling is simple. Follow these steps.

Check If PyPDF2 Is Installed

First, verify if PyPDF2 is installed. Use the pip show command in your terminal.

 
pip show PyPDF2


Name: PyPDF2
Version: 3.0.1
Summary: A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files
...

If PyPDF2 is installed, you'll see its details. If not, you'll get a "not found" message.

Uninstall PyPDF2 Using Pip

The easiest way to uninstall PyPDF2 is with pip uninstall. Run this command.

 
pip uninstall PyPDF2


Found existing installation: PyPDF2 3.0.1
Uninstalling PyPDF2-3.0.1:
  Would remove:
    /path/to/PyPDF2
Proceed (Y/n)? Y
  Successfully uninstalled PyPDF2-3.0.1

Confirm the uninstallation by typing Y when prompted. That's it!

Verify Uninstallation

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

 
pip show PyPDF2


WARNING: Package(s) not found: PyPDF2

This confirms PyPDF2 is no longer installed.

Troubleshooting

Sometimes, you might face issues. Here are common fixes.

Permission Errors

If you get permission errors, try adding --user.

 
pip uninstall PyPDF2 --user

Multiple Python Versions

If you have multiple Python versions, specify the correct pip. For example, use pip3 for Python 3.

 
pip3 uninstall PyPDF2

Package Not Found

If pip can't find PyPDF2, it might be installed in a virtual environment. Activate the environment first.

 
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate    # Windows
pip uninstall PyPDF2

Alternative Methods

If pip doesn't work, try these alternatives.

Using Python Interactive Shell

You can use Python's interactive shell to uninstall PyPDF2.

 
import sys
import subprocess

subprocess.check_call([sys.executable, "-m", "pip", "uninstall", "PyPDF2"])

Manual Removal

As a last resort, manually delete PyPDF2 files. Find the installation path with pip show PyPDF2 and delete the folder.

Conclusion

Uninstalling PyPDF2 is straightforward with pip uninstall. Always verify the uninstallation. If you face issues, try the troubleshooting steps.

Need to uninstall other packages? Check our guides on How to Uninstall Xlrd in Python or How to Uninstall Openpyxl in Python.

Remember, keeping your Python environment clean is important. Remove unused packages to avoid conflicts.