gpt4 book ai didi

opencv - conda python 3.7 opencv 导入错误 libgnutls.so.30 : undefined symbol: mpn_add_1, 版本 HOGWEED_4

转载 作者:行者123 更新时间:2023-12-04 13:31:36 31 4
gpt4 key购买 nike

在 Ubuntu 20.04 上让 opencv 在 Conda 中使用 python 3.7 时遇到问题。
当我尝试在 python 中导入 cv2 时出现以下错误:

$ python
Python 3.7.8 | packaged by conda-forge | (default, Jul 23 2020, 03:54:19)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /home/swagat/anaconda3/envs/tf2py37/lib/python3.7/site-packages/../../././libgnutls.so.30: undefined symbol: mpn_add_1, version HOGWEED_4

我的 Conda 配置如下所示:

active environment : tf2py37
active env location : /home/swagat/anaconda3/envs/tf2py37
shell level : 2
user config file : /home/swagat/.condarc
populated config files :
conda version : 4.8.5
conda-build version : 3.18.9
python version : 3.7.4.final.0
virtual packages : __cuda=10.1
__glibc=2.31
我使用以下命令从 conda-forge channel 安装了 opencv: $ conda install -c conda-forge opencv我可以看到我的系统上安装了 opencv:
$ conda list opencv
# packages in environment at /home/swagat/anaconda3/envs/tf2py37:
#
# Name Version Build Channel
libopencv 4.5.0 py37_2 conda-forge
opencv 4.5.0 py37_2 conda-forge
py-opencv 4.5.0 py37hc6149b9_2 conda-forge
我还检查了是否安装了 gnutls:
$ conda list gnutls
# packages in environment at /home/swagat/anaconda3/envs/tf2py37:
#
# Name Version Build Channel
gnutls 3.6.13 h79a8f9a_0 conda-forge
我还能尝试什么来解决这个问题?我有点卡在这里。任何帮助将不胜感激。谢谢。

最佳答案

似乎 opencv 的 conda 版本已损坏。
我的解决办法是:
删除您的 conda opencv 并安装 native :

conda remove opencv


python -m pip install opencv-python # Execute this with your conda env activated

关于opencv - conda python 3.7 opencv 导入错误 libgnutls.so.30 : undefined symbol: mpn_add_1, 版本 HOGWEED_4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64790390/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com