You have a wrong $PYTHONPATH, that probably doesn't contain the path to the virtualenv libs!
As soon as you set $PYTHONPATH, pathes are used only as given here and implicit pathes to libs from your virtualenv are not considered anymore if not explicitly defined in $PYTHONPATH.
Please try first, if python works alone. If you get similar result, it have a wrong PYTHONPATH.
Activate your desired virtualenv and run:
$ python
Traceback (most recent call last):
File "/data/appl/mmtools/lib/python2.7/site-packages/site.py", line 74, in <module>
__boot()
File "/data/appl/mmtools/lib/python2.7/site-packages/site.py", line 2, in __boot
import sys, os, os.path
File "/data/appl/py27/lib64/python2.7/os.py", line 49, in <module>
import posixpath as path
ImportError: No module named posixpath
Then unset $PYTHONPATH:
unset PYTHONPATH
Now try again running python
Python 2.7.5 (default, Mar 26 2019, 22:13:06)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
If you have the same problem, you need to carefully check $PYTHONPATH.
Keep in mind: If you want to switch between multiple virtualenv's, you have to always update your $PYTHONPATH accordingly by adding/exchanging the pathes of virtualenv AND your package path, because it is not automatically done when activating another virtualenv.
The better approach is to use a ".pth" file in your virtualenv.
Unset $PYTHONPATH or remove it from your login (.bash_profile, .bashrc, ...)
Create a file in your virtualenv, e.g. $VIRTUALENV/lib/python2.7/site-packages/mypackages.pth with one line per path to your packages as they were in $PYTHONPATH:
/path-to-your-packages/...
Run python and it should start without error and also find your packages
If you have different package versions for various virtualenv, you can define correct pathes for each virtualenv in your '.pth' file and you shouldn't define nor need $PYTHONPATH anymore.
Activating another env finds then correct pathes automatically.