opencv python system conflict

asked 2017-10-05 08:44:46 -0500

naikin gravatar image

updated 2017-10-05 08:45:31 -0500

I installed ROS kinetic from source. Thus I had to set the PYTHONPATH variable myself. The problem is that when I try to import opencv in python, the ROS module is being imported rather than the system installed OpenCV. In fact, this happens even if I try import cv2 in python3. The reason is that the ROS module is called the exact same way cv2 and the python interpreter first searches the directories in PYTHONPATH and only then it searches the default python directories. If PYTHONPATH is not set, then the behavior is correct and the system installed cv2 module is imported.

Is it normal that the ROS module is called the exact same way as the system module (cv2) and is not that a very bad practice or did I compile something incorrectly?

edit retag flag offensive close merge delete