Unable to uninstall virtualenv on Ubuntu 20.04.2 LTS

$ sudo pip uninstall virtualenv
WARNING: Skipping virtualenv as it is not installed.
$ sudo pip3 uninstall virtualenv
WARNING: Skipping virtualenv as it is not installed.
$ sudo apt-get purge python-virtualenv
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python-virtualenv' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 136 not upgraded.
$ virtualenv --version
virtualenv 20.4.3 from /home/manu/.local/lib/python3.8/site-packages/virtualenv/__init__.py

pip list and pip3 list mention the virtualenv.

Also, commands mentioned here do not work:

sudo apt-get remove virtualenv
sudo apt-get remove --auto-remove virtualenv
sudo apt-get purge python-virtualenv
sudo apt-get purge --auto-remove python-virtualenv
9

1 Answer

Take a look at your venv location: /home/manu/.local/lib/python3.8/site-packages/virtualenv/init.py. The .local directory means that it didn't come from a deb or Snap package. Maybe from pip. Maybe from some other method.

The python3.8 directory tells you which version of Python uses it, so your commands should be python3 and pip3 -- Py2-specific commands won't help.

Since you queried pip3, and it never heard of virtualenv, seems safe enough to delete that directory.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like