Ask Your Question

Revision history [back]

asdfasdfasdfdsa

asdfasdfasdfdsa I was able to figure out a solution that works. An option is working with sys.path, there is apparently another one with $PYTHONPATH but that didn't run on my system - I short guess would be, that here a library is just appended to the path and if one already has a working library of this kind in its path, the first one - in this case the deprecated opencv is chosen.

However working with sys.path lets you put the library at any desired position. To make it short:

import sys
sys.path.insert(0,'<path-to-better-lib>')
import cv2

the number stands for the position in the path-string: 0 means put on very first place so the later cv2.so will just be ignored.

N.B.: of course this will work with other libraries too, just replace import cv2 respectively. That's how to deal with multiple versions of a library installed on one workstation in python

I was able to figure out a solution that works. An option is working with sys.path, there is apparently another one with $PYTHONPATH but that didn't run on my system - I short guess would be, that here a library is just appended to the path and if one already has a working library of this kind in its path, the first one - in this case the deprecated opencv is chosen.

However working with sys.path lets you put the library at any desired position. To make it short:

import sys
sys.path.insert(0,'<path-to-better-lib>')
import cv2

the number stands for the position in the path-string: 0 means put on very first place so the later cv2.so will just be ignored.

N.B.: of course this will work with other libraries too, just replace import cv2 respectively. That's how to deal with multiple versions of a any (not just cv) library installed on one workstation in python

I was able to figure out a solution that works. An option is working with sys.path, there is apparently another one with $PYTHONPATH but that didn't run on my system - I short guess would be, that here a library is just appended to the path and if one already has a working library of this kind in its path, the first one - in this case the deprecated opencv is chosen.

However working with sys.path lets you put the library at any desired position. To make it short:

import sys
sys.path.insert(0,'<path-to-better-lib>')
import cv2

the number stands for the position in the path-string: 0 means put on very first place so the later cv2.so will just be ignored.

N.B.: of course this will work with other libraries too, just replace import cv2 respectively. That's how to deal with multiple versions of any (not just cv) library libs installed on one workstation in python

I was able to figure out a solution that works. An option is working with sys.path, there is apparently another one with $PYTHONPATH but that didn't run on my system - I short guess would be, that here a library is just appended to the path and if one already has a working library of this kind in its path, the first one - in this case the deprecated opencv is chosen.

However working with sys.path lets you put the library at any desired position. To make it short:

import sys
sys.path.insert(0,'<path-to-better-lib>')
import cv2

the number stands for the position in the path-string: 0 means put on very first place so the later cv2.so will just be ignored.

example for <'path-to-better-lib'> : ~/newOpencv/lib/python2.7/dist-packages, that's where the cv2.so resides, which represents opencv

N.B.: of course this will work with other libraries too, just replace import cv2 respectively. That's how to deal with multiple versions of any (not just cv) libs installed on one workstation in python