gpt4 book ai didi

python - ImportError : dlopen(. ..):找不到符号:__PyCodecInfo_GetIncrementalDecoder

转载 作者:行者123 更新时间:2023-12-01 04:03:56 38 4
gpt4 key购买 nike

我是Python的初学者。当我尝试 python chainer/examples/mnist/train_mnist.py 时,发生错误。我想执行 chainer。

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

如何解决这个错误?

最佳答案

伙计,当我尝试让 opencv 在 Mac Os El Captain 中工作时,我得到了类似的日志。经过一段时间的尝试,我通过从 homebrew 卸载 numpy,然后从 pip 卸载来做到了。看起来他们之间有冲突。之后只需通过自制程序安装即可运行。

brew uninstall numpy
pip uninstall numpy
brew install numpy

如果这不能尝试从自制软件重新安装 python,并确保你有 xcode 命令行工具:

xcode-select --install

希望有帮助。

关于python - ImportError : dlopen(. ..):找不到符号:__PyCodecInfo_GetIncrementalDecoder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35989572/

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