my current bash shell is loaded with python3 but occasionally I tend to run old python2 scripts and I get this error
python/2.7.10/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory"
so every-time I had to load python2 back and forth. Is there a way to run python2 script in python3 environment by just changing any environmental variables?
which python,which python2,which python3? Generally: (1) You should not be simultaneously using python2 and python3 at the same time. (2) Users should be specifying in the old python scripts which verison of python to use. If that is the case, you can install a virtualenv such as conda. (3) When you need to, you can quickly change from a python3 virtual env to a python2 virutal env. - Scott Skiles