Last modified: Oct 02, 2026

Uninstall Python Package Without pip

Most Python users rely on pip to remove packages. It is simple and fast.

But pip is not always available. Sometimes it is broken, missing, or blocked by your system.

You may also work on a machine with no internet access. In these cases, you need another way.

This guide shows you how to uninstall a Python package without pip. We cover several methods.

Each method works in different situations. Read on to find the one that fits your setup.

Why You Might Not Use pip

There are many reasons to skip pip. Here are the most common ones.

  • pip is not installed on the system.
  • pip is broken or gives errors.
  • You have no internet connection.
  • A company policy blocks pip.
  • The package was installed by another tool.

In all these cases, manual removal is your best option.

Method 1: Remove the Package Folder Manually

Python packages live inside your site-packages directory. You can delete the folder by hand.

First, find where Python stores its packages. Run this command in your terminal.


import site
print(site.getsitepackages())

The site.getsitepackages() function returns a list of paths. These are your package folders.

Here is an example output.


['/usr/local/lib/python3.10/site-packages']

Now go to that folder. Look for the package you want to remove.

For example, to remove a package named requests, delete its folder.


cd /usr/local/lib/python3.10/site-packages
rm -rf requests

This removes the main package. But you must also remove leftover files.

Check for a folder ending in .dist-info or .egg-info. Delete those too.


rm -rf requests-2.28.1.dist-info

After this, the package is gone. Try importing it to confirm.


import requests

If you see a ModuleNotFoundError, the removal worked.


ModuleNotFoundError: No module named 'requests'

Method 2: Use setup.py to Uninstall

Some packages include a setup.py file. You can use it to remove the package.

Go to the folder that holds the package source. Then run this command.


python setup.py install --record files.txt

This creates a file called files.txt. It lists every installed file.

Now remove each file in the list.


cat files.txt | xargs rm -rf

This method is clean. It removes all files the package added.

But it only works if you still have the source code. Many users do not.

Method 3: Uninstall with Conda

If you use Anaconda or Miniconda, you may not need pip at all.

Conda has its own remove command. Use it like this.


conda remove requests

Conda handles all dependencies for you. It is safer than manual deletion.

You can also remove a package from a specific environment.


conda remove -n myenv requests

This keeps your base environment clean. It is a good habit to use environments.

Method 4: Remove from a Virtual Environment

Virtual environments keep packages separate. This makes removal much easier.

If a package is only in a venv, just delete the whole environment.


rm -rf myenv

Then create a fresh environment. This is the cleanest way to start over.


python -m venv myenv
source myenv/bin/activate

This method is fast and safe. It avoids conflicts with system packages.

Method 5: Use importlib to Find the Package

Sometimes you do not know where a package lives. Python can tell you.

Use the importlib.util.find_spec() function to locate it.


import importlib.util

spec = importlib.util.find_spec("requests")
print(spec.origin)

This prints the exact path to the package file. Here is an example.


/usr/local/lib/python3.10/site-packages/requests/__init__.py

Now you know the folder. You can delete it manually as shown before.

This is very useful when packages are hidden in odd locations.

Important Things to Remember

Manual removal has risks. Keep these points in mind.

  • Back up your environment before deleting files.
  • Remove .dist-info and .egg-info folders too.
  • Check for dependencies that may break.
  • Test your code after removal.

If you remove a package that others depend on, your code may fail.

Always test in a safe environment first.

When to Reinstall pip Instead

Sometimes the real problem is a broken pip. Fixing pip may be easier.

You can reinstall pip with this command.


python -m ensurepip --upgrade

After that, pip works again. Then you can uninstall packages the normal way.


pip uninstall requests

This is often the fastest fix. Try it before manual removal.

Conclusion

You do not always need pip to remove a Python package. Manual deletion works well.

You can delete the package folder in site-packages. You can use setup.py or conda.

Virtual environments make the job even easier. Just delete the whole environment.

Always back up your files first. Then test your code after removal.

With these methods, you can manage Python packages on any system. Even without pip.