我最初使用这个脚本从源代码安装了openCV。
当我测试时,它能够正常工作。
之后我安装了ROS kinetic,并打开了python3
,运行import cv2 as cv
,出现了以下错误:
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
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
ldd /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so
,echo $PYTHONPATH
,(在Python控制台中)import sys; print(sys.path)
。 - at-2500