gpt4 book ai didi

ubuntu - cmake opencv3 with python2 on ubuntu get ImportError multiarray.so : undefined symbol: _Py_ZeroStruct

转载 作者:行者123 更新时间:2023-12-04 18:45:51 29 4
gpt4 key购买 nike

我尝试使用 cmake-gui在 ubuntu 上为 python2.7 构建 opencv3。我有我的 numpy(1.8.2)pip 安装(实际上,我也尝试过 apt-get 但仍然存在错误)。每次使用cmake-guiConfigure它让我觉得:

Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: _Py_ZeroStruct

Original exception was:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 6, in <module>
from . import multiarray
ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: _Py_ZeroStruct**strong text**
_Py_ZeroStruct 好像有问题.我已尝试重新安装 numpy ,但它没有用。

我也尝试忽略此错误并保留 make && sudo make install结果是我可以正确安装我的 OpenCV3 但我不能使用 cv2 python的(没有名为 cv2的模块)。
因此,我相信这个错误是我必须解决的关键问题。

最佳答案

我想到了:

我应该确保没有 dist-packagesite-package路径位于 $PYTHONPATH

关于ubuntu - cmake opencv3 with python2 on ubuntu get ImportError multiarray.so : undefined symbol: _Py_ZeroStruct,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41843393/

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