I\'m running Mac OS 10.6.8. and wanted to install in addition to python 2.6 also python 2.7 and use python 2.7 in a new virtualenv. I executed the following steps:
I
Just bumped into this issue on a Centos 7.4.
None of the above answers suited my case. After quite a bit of digging around I pinpointed this to too-strict file permissions in python libs (I guess python installation on Centos differs a bit from other POSIX systems).
So, if everything else fails you might want to check that your python libs are readable by the user you're trying to run virtualenvwrapper with.
In particular check:
/usr/lib/python3.6
/usr/lib64/python3.6
(amend the paths for different python versions).
If you see that group and others lack read and execute permissions in there then add them:
sudo chmod og+rx -R /usr/lib/python3.6
sudo chmod og+rx -R /usr/lib64/python3.6
Note:
I'm not sure whether this works against a Centos security policy but it's probably safe as long as you don't give write persmisions.