Last modified: Jun 23, 2025 By Alexander Williams

How to Uninstall PyAutoGUI in Python

PyAutoGUI is a popular Python library for automating GUI tasks. Sometimes, you may need to uninstall it. This guide will show you how.

Why Uninstall PyAutoGUI?

You might want to uninstall PyAutoGUI for several reasons. Maybe you no longer need it. Or you want to free up space. Or you need to reinstall a different version.

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

Check If PyAutoGUI Is Installed

Before uninstalling, check if PyAutoGUI is installed. Open your terminal or command prompt. Run the following command:


pip show pyautogui

If PyAutoGUI is installed, you will see details about it. If not, you will see a message saying it is not found.

Uninstall PyAutoGUI Using pip

The easiest way to uninstall PyAutoGUI is using pip. Run the following command:


pip uninstall pyautogui

You will see a confirmation prompt. Type y and press Enter. PyAutoGUI will be uninstalled.

Verify Uninstallation

After uninstalling, verify it is removed. Run the pip show pyautogui command again. You should see a message saying it is not installed.

Uninstall PyAutoGUI in a Virtual Environment

If you use a virtual environment, activate it first. Then run the uninstall command. Here’s how:


source venv/bin/activate  # For Linux/Mac
pip uninstall pyautogui

Or for Windows:


venv\Scripts\activate
pip uninstall pyautogui

Uninstall PyAutoGUI Using Python

You can also uninstall PyAutoGUI using Python. Run the following code in your Python interpreter:

 
import pip
pip.main(['uninstall', 'pyautogui'])

This will start the uninstallation process. Confirm by typing y when prompted.

Common Issues and Fixes

Sometimes, uninstalling PyAutoGUI may fail. Here are some common issues and fixes.

Permission Denied: Run the command with admin rights. Use sudo on Linux/Mac or run as admin on Windows.


sudo pip uninstall pyautogui

Package Not Found: Ensure you spelled PyAutoGUI correctly. Check with pip list.

Conclusion

Uninstalling PyAutoGUI is straightforward. Use pip uninstall pyautogui and confirm the action. Verify the uninstallation to ensure it is removed.

If you face issues, check permissions or spelling. For more guides, see How to Uninstall Selenium in Python or How to Uninstall Requests in Python.

Now you know how to remove PyAutoGUI from your system. Happy coding!