This is usually because setuptools is not installed correctly.
Verify that the pip package manager is installed, if not you can do so by using the following command:
sudo apt-get install python-pip
Verify that setuptools is installed correctly. If it is not installed, you can install it with the following command:
sudo apt-get install python-setuptools
Upgrade setuptools:
sudo easy_install -u setuptools
Clear cache:
sudo rm -rf ~/.cache/pip/
Reinstall virtual environment:
sudo pip install virtualenv
Still does not solve the problem, you can try to remove the old version of setuptools and reinstall the latest version.
csharp
Copy code
sudo apt-get remove python-setuptools
sudo pip install setuptools