问题描述
我从未见过这样的错误,不知道从哪里开始.我用
I've never seen an error like this and don't know where to start. I installed opencv with
conda install opencv
并且我正在使用名为 fpn 的 conda 环境运行 Ubuntu Linux 18.04.我什至应该如何调试这个?
and am running Ubuntu Linux 18.04 using a conda environment named fpn. How should I even approach debugging this?
Traceback (most recent call last):
File "test.py", line 5, in <module>
import cv2
ImportError: /home/s/miniconda3/envs/fpn/lib/python3.7/site-packages/../../././libgnutls.so.30: symbol mpn_add_1 version HOGWEED_4 not defined in file libhogweed.so.4 with link time reference
推荐答案
最近发布的用于 Conda 的 opencv 包似乎存在问题.我测试了所有4.x版本,发现问题出现从 4.3 开始.除非你真的依赖 >=4.3,否则强制使用 4.3 之前的版本可以解决问题,
There seems to be a problem with the recent releases of opencv packages for Conda. I have tested all the 4.x releases and found that the problem occurs starting from 4.3. Unless you really depend on >=4.3, forcing a version prior to 4.3 solves the problem,
name: test
channels:
- anaconda
- conda-forge
dependencies:
- python>=3.8
- opencv<4.3
在我的情况下,这安装了 4.2.0.然后在 Python 中导入 cv2
工作正常.请注意,使用 conda update
对我不起作用,我仍然遇到错误,但我必须先 删除环境,然后重新创建它.我认为这种行为表明错误根源于 opencv 的某些依赖,当使用 conda update
时,它没有正确降级.
in my cases this installed 4.2.0. Importing cv2
in Python works fine then. Note that using conda update
didn't work for me and I still got the error, but I had to first remove the environment and then re-create it. I think this behavior indicates that the error is rooted in some dependency of opencv, which is not properly down-graded when conda update
is used.
这篇关于导入 CV2 时收到来自 lingnutls/'Hogweed' 的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!