Opencv 3 and 2 on the same computer

asked 2015-09-15 04:05:58 -0500

Mehdi. gravatar image

Because I am using a lot of stuff based on opencv 2 (ex. ROS and Gazebo) and installing opencv 3 will simply destroy everything, I downloaded the source code of opencv 3 , compiled it and installed it to a local folder in my home directory. Now I want to use that version when running python scripts. What do I need to change? And isn't there any option to make an alternative name spacing on opencv3 ? like for example doing "import cv2_3" in Python?

Using Ubuntu 14.04

edit retag flag offensive close merge delete


Have you seen this? I do not know too much about python, but maybe it helps. More: it may be a duplicate

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-09-15 04:18:11 -0500 )edit

What should I do with that link?

Mehdi. gravatar imageMehdi. ( 2015-09-15 04:26:04 -0500 )edit

Have you tried >>> import cv2, >>> print cv2.__version__ ? what is it printing?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-09-15 06:36:21 -0500 )edit

Yes it is always 2.4.8 no matter what I do, I exported the dist-packages of opencv 3.0 to the beginning of PYTHONPATH and I exported the opencv 3 libs path to the beginning of LD_LIBRARY_PATH, and I am running python after setting those env variables, still python is always importing 2.4.8

Mehdi. gravatar imageMehdi. ( 2015-09-15 07:02:26 -0500 )edit