Ros installed,when import cv2 in anaconda2 py3 appear error like this:
Ros installed,when import cv2 in anaconda2 py3 appear error like this:
Obviously,error appeared in /opt/ros bagfile, there are prety solutions in google,but this order is best:
The problem here is that Python is looking for a package in /opt/ros/kinetic/lib/python2.7/dist-packages/ when it should be looking in the Anaconda installation directories. The reason for this is that with your ROS install, your .bashrc file contains the line source /opt/ros/kinetic/setup.bash, which sets your PYTHONPATH variable to the /opt/ros/kinetic/... location.
The solution is to unset your PYTHONPATH variable before sourcing your Anaconda environment:
$ unset PYTHONPATH
$ source activate RoboND
And it should work! But in this case, you'll need to remember to do this each time you want to use your Anaconda Python install.
When you activate your Anaconda python environment everytime,you should input this order:unset PYTHONPATH.