import cv2 error caused by ROS!
I have anaconda installed. which python
gives me the following output:
/home/nehal/anaconda3/bin/python
Now when I start python on command line, it starts the anaconda's python but import cv2
gives me the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
In the .bashrc I have :
export PATH="/home/nehal/anaconda3/bin:$PATH"
export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/dist-packages:$PYTHONPATH"
ROS_IP=
ROS_HOSTNAME=
ROS_MASTER_URI=
source /opt/ros/kinetic/setup.bash
source ~/catkin_ws/devel/setup.bash
and nothing else related to python in .bashrc
nehal@nehal-Inspiron-5559:~$ echo $PYTHONPATH
/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-packages:/home/nehal/anaconda3/lib/python3.6/dist-packages:/home/nehal/anaconda3/lib/python3.6/dist-packages:/home/nehal/anaconda3/lib/python3.6/dist-packages:/home/nehal/anaconda3/lib/python3.5/dist-packages:/home/userx/anaconda3/lib/python3.5/dist-packages:/home/userx/anaconda3/lib/python3.5/dist-packages:/home/userx/anaconda3/lib/python3.5/dist-packages