Last modified: Jun 23, 2025 By Alexander Williams
How to Uninstall PyJWT in Python
PyJWT is a library for encoding and decoding JSON Web Tokens (JWT) in Python. Sometimes, you may need to uninstall it. This guide will help you remove PyJWT cleanly.
Table Of Contents
Why Uninstall PyJWT?
You might want to uninstall PyJWT for several reasons. Maybe you no longer need it, or you want to switch to another library. It could also be due to version conflicts.
Whatever the reason, uninstalling PyJWT is simple. Follow the steps below.
Check If PyJWT Is Installed
First, verify if PyJWT is installed. Use the pip show
command.
pip show PyJWT
If PyJWT is installed, you will see details like version and location. If not, you'll get a "not found" message.
Uninstall PyJWT Using Pip
To uninstall PyJWT, use the pip uninstall
command. This is the easiest method.
pip uninstall PyJWT
You will see a confirmation prompt. Type y and press Enter to proceed.
Force Uninstall PyJWT
If the standard uninstall fails, use the --yes
flag to force it.
pip uninstall PyJWT --yes
This skips the confirmation prompt. It's useful for automated scripts.
Verify PyJWT Is Uninstalled
After uninstalling, check if PyJWT is removed. Run the pip show
command again.
pip show PyJWT
If PyJWT is uninstalled, you'll see a "not found" message.
Remove PyJWT Dependencies
PyJWT may have dependencies. To remove them, use the pip autoremove
command.
pip autoremove PyJWT
This removes unused dependencies. Be careful as it might affect other packages.
Uninstall PyJWT in a Virtual Environment
If you're using a virtual environment, activate it first. Then run the uninstall command.
source venv/bin/activate
pip uninstall PyJWT
This ensures PyJWT is removed only from the virtual environment.
Common Issues and Fixes
Sometimes, uninstalling PyJWT may fail. Here are some common issues and fixes.
Permission Denied: Use sudo
if you get permission errors.
sudo pip uninstall PyJWT
Package Not Found: Ensure you spelled PyJWT correctly. It's case-sensitive.
For more help, check our guide on How to Uninstall Cryptography in Python.
Alternative Methods
If pip fails, you can manually delete PyJWT. Locate the package and remove it.
Find the installation path using pip show PyJWT
. Then delete the folder.
Be cautious with manual deletion. It may cause issues if not done correctly.
Conclusion
Uninstalling PyJWT is straightforward. Use pip uninstall
for a clean removal. Verify with pip show
.
If you encounter issues, try force uninstall or manual deletion. For more tips, see our guide on How to Uninstall Pylint in Python.
Need to uninstall other packages? Check our guide on How to Uninstall Mypy in Python.