基于ros-kinetic ubuntu16.04 遇到如下报错
File "camera_calibration.py", line 4, in <module>
import cv2
ImportError: No module named 'cv2'
具体解决流程如下:
1、因为在ros中默认安装了python2.7和3.5版本,所VScode中需要指定python版本
遇到报错
Traceback (most recent call last):
File "/home/utryjc/PycharmProjects/qtWayPionts/ui_main.py", line 4, in <module>
import cv2
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
Process finished with exit code 1
在文件开头标注即可(提前将cv2.so文件复制到dist-packages中)参考