I need help with the next situation. There is one project, that is requiring two versions of one library. Let this lib be lib, and its versions: libold and libnew. These libs are not accessible via pypi, i.e. they are each in their own folder. Let the paths of these folders be /path/to/libold and /path/to/libnew.
In my project I need instances of classes from both these libs, but I can't import them both, but only either old or new lib.
I tried the next method:
import sys
sys.path.insert(0,'path/to/libold')
import lib as libold
sys.path.pop(0)
sys.path.insert(0,'path/to/libnew')
import lib as libnew
After performing this commands, libold and libnew represents the same library, libold.
I also tried importlib and imp and got same result.
How can I perform importing 2 versions of a lib?