重要错误:dlopen(…):找不到符号:PyCodecInfo GetIncrementalDecod

2021-06-14 23:14:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我是Python的初学者。 当我尝试python chainer/examples/mnist/train_mnist.py时,出现了错误。 我想处决查纳。

Traceback (most recent call last):
  File "chainer/examples/mnist/train_mnist.py", line 10, in <module>
    import numpy as np
  File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py", line 58, in <module>
    from numpy.testing import Tester
  File "/usr/local/lib/python2.7/site-packages/numpy/testing/__init__.py", line 14, in <module>
    from .utils import *
  File "/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 15, in <module>
    from tempfile import mkdtemp
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 32, in <module>
    import io as _io
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

我怎样才能解决这个错误??

1条回答
网友
1楼 ·

伙计,当我试图让opencv在Mac Os El Captain工作时,我也得到了一个类似的日志。经过一段时间的尝试,我从自制程序中卸载了numpy,然后从pip中卸载了numpy。看起来他们在冲突中。在那之后,它通过自制程序安装,并且工作正常。

brew uninstall numpy
pip uninstall numpy
brew install numpy

如果不尝试从自制程序重新安装python,请确保使用xcode命令行工具:

xcode-select --install

希望有帮助。

相关问题