简体   繁体   English

import dlib找不到ImportError符号:_PyClass_Type

[英]import dlib ImportError Symbol not found: _PyClass_Type

When I run import dlib in Python 3.6 I get the following error: 当我在Python 3.6中运行import dlib ,我收到以下错误:

Traceback (most recent call last):
File "demo.py", line 3, in <module>
import dlib
File "/usr/local/lib/python3.6/site-packages/dlib/__init__.py", line 1, in <module>
from .dlib import *
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/dlib/dlib.so, 2): Symbol not found: _PyClass_Type
Referenced from: /usr/local/opt/boost-python/lib/libboost_python-mt.dylib
Expected in: flat namespace in /usr/local/opt/boost-python/lib/libboost_python-mt.dylib

I tried unistalling boost-python and then brew install boost-python --with-python3 with no result. 我试着unistalling boost-python然后brew install boost-python --with-python3没有结果。

Here is also the output of otool -L /usr/local/lib/libboost_python.dylib : 这里也是otool -L /usr/local/lib/libboost_python.dylib的输出:

/usr/local/lib/libboost_python.dylib:
/usr/local/opt/boost-python/lib/libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)

I am not feeling very strong in terms of linking errors, any ideas would be appreciated. 我在链接错误方面感觉不是很强烈,任何想法都会受到赞赏。

Check folder /usr/local/opt/boost-python/lib/ , there are these files: 检查文件夹/usr/local/opt/boost-python/lib/ ,有以下文件:

/u/l/l/p/site-packages> cd /usr/local/opt/boost-python/lib/
/u/l/C/b/1/lib> ls
libboost_numpy-mt.a       libboost_numpy3-mt.a      libboost_python-mt.a      libboost_python3-mt.a
libboost_numpy-mt.dylib   libboost_numpy3-mt.dylib  libboost_python-mt.dylib  libboost_python3-mt.dylib
libboost_numpy.a          libboost_numpy3.a         libboost_python.a         libboost_python3.a
libboost_numpy.dylib      libboost_numpy3.dylib     libboost_python.dylib     libboost_python3.dylib

Create a folder backup these files, then copy files with number 3 to files without number 3. For example, copy libboost_python3-mt.dylib to libboost_python-mt.dylib , then it will work. 创建一个备份这些文件的文件夹,然后将编号为3的文件复制到没有编号3的文件。例如,将libboost_python3-mt.dylib复制到libboost_python-mt.dylib ,然后它就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到dlopen符号:_PyClass_Type - dlopen Symbol not found: _PyClass_Type ImportError:/usr/lib/libboost_python.so.1.54.0:未定义的符号:PyClass_Type - ImportError: /usr/lib/libboost_python.so.1.54.0: undefined symbol: PyClass_Type 张量流导入错误:_pywrap_tensorflow_internal.so:未定义符号:PyClass_Type - tensorflow import error: _pywrap_tensorflow_internal.so: undefined symbol: PyClass_Type 使用 Mac Mojave 和 brew 安装 cgal-swig-bindings,之后找不到错误符号:_PyClass_Type - installing cgal-swig-bindings with Mac Mojave and brew, after that getting the Error Symbol not found: _PyClass_Type import dlib ImportError:Ubuntu 18.04 中没有名为 dlib 的模块 - import dlib ImportError: No module named dlib in Ubuntu 18.04 由于ImportError无法在python 3中导入dlib - Unable to import dlib in python 3 due to ImportError 为什么我会收到此错误“ImportError: dlopen(...): Symbol not found”? 当我在 python 上导入我的库时 - Why do I get this error “ImportError: dlopen(…): Symbol not found”? when I import my library on python ImportError:没有名为“dlib”的模块 - ImportError: No module named 'dlib' ImportError ::找不到符号:__PyErr_ReplaceException - ImportError: : Symbol not found: __PyErr_ReplaceException ImportError:dlopen(…):找不到符号:__PyCodecInfo_GetIncrementalDecoder - ImportError: dlopen(…): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM