1. 程式人生 > >解決安裝ros後anaconda中無法import cv2

解決安裝ros後anaconda中無法import cv2

>>> import sys
>>> print(sys.path)

得到

>>>['', '/opt/ros/kinetic/lib/python2.7/dist-packages', '/home/ysy/anaconda3/envs/tensorflow/lib/python36.zip', '/home/ysy/anaconda3/envs/tensorflow/lib/python3.6', '/home/ysy/anaconda3/envs/tensorflow/lib/python3.6/lib-dynload', '/home/ysy/anaconda3/envs/tensorflow/lib/python3.6/site-packages']

此時

>>> sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')