【发布时间】:2018-10-07 09:18:19
【问题描述】:
以前 ROS 安装在我的系统中,它需要 opencv 来实现,现在我正在使用 anaconda,我需要再次使用 opencv 库。在编写python代码时import cv2会抛出错误module not found。
有没有办法使用 ROS 安装在 anaconda 中的那个 opencv 库
虽然我再次使用 conda 安装了 opencv。
$conda install -c conda-forge opencv
然而 opencv-3.3 是使用上述命令安装的。现在我的 python 代码显示不同的导入错误,如下所示:
ImportError Traceback (most recent call last)
<ipython-input-9-6b49ad4d4ca5> in <module>()
1 from random import shuffle
2 import glob
----> 3 import cv2
4 shuffle_data = True # shuffle the addresses before saving
5 hdf5_path = 'dataset.hdf5' # address to where you want to save the hdf5 file
ImportError: /home/kamal/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type
如何具体指定要使用的 opencv 库。我需要更改哪些环境变量。 任何帮助将不胜感激。
【问题讨论】:
标签: linux python-3.x opencv