尝试编译Python包装器

问题描述 投票:0回答:0

我正在尝试使用该存储库: https://github.com/PierreFritsch/OpenCV-Python-C-Module-for-Image-Processing

在我的 18.04 Ubuntu 计算机上编译工作正常。但是,当我在 20.04 Ubuntu 计算机上尝试导入库时,出现以下错误:

python3.8
Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import helloWorld
/home/xavier/.local/lib/python3.8/site-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.15) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.8/dist-packages/helloWorld-1.0-py3.8-linux-x86_64.egg/helloWorld.abi3.so: undefined symbol: _ZN5pbcvt16fromMatToNDArrayERKN2cv3MatE

我在第二台电脑上使用python3.8。为什么我的第二台电脑上编译不工作?

我查看了生成的库。当我查看库时

helloWorld.abi3.so
,我找不到相同的符号:

readelf -s /usr/local/lib/python3.8/dist-packages/helloWorld-1.0-py3.8-linux-x86_64.egg/helloWorld.abi3.so | grep fromMatToNDA -A 2 -B 2
     6: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_atexit@GLIBC_2.2.5 (2)
     7: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@GLIBC_2.4 (3)
     8: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN5pbcvt16fromMatToNDArr
     9: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND PyArg_ParseTuple
    10: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN5pbcvt16fromNDArrayToM
--
    72: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_atexit@@GLIBC_2.2.5
    73: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __stack_chk_fail@@GLIBC_2
    74: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN5pbcvt16fromMatToNDArr
    75: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND PyArg_ParseTuple
    76: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN5pbcvt16fromNDArrayToM`
c++ setuptools python-3.8
© www.soinside.com 2019 - 2024. All rights reserved.