简体   繁体   English

受 ROS 动力学 cv2 安装影响的导入 cv2 错误

[英]import cv2 error affected by ROS kinetic cv2 installation

I encountered this error when attempting to run a python3 script with the line import cv2.尝试使用 import cv2 行运行 python3 脚本时遇到此错误。 Seems like it is affected by my ROS kinetic installation似乎它受到我的 ROS 动力学安装的影响

    import cv2
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type

Add this line to the top of the code将此行添加到代码顶部

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM