4

I'm a beginner of python. When I try python chainer/examples/mnist/train_mnist.py, Error occured. I want to execute 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

How can I resolve this error??

komuya
  • 71
  • 1
  • 1
  • 6
  • Maybe [this question](http://stackoverflow.com/questions/34386527/symbol-not-found-pycodecinfo-getincrementaldecoder-trying-to-register-a-packa) helps. – lrnzcig Mar 14 '16 at 14:17

1 Answers1

2

Man I got a similar log when trying to make opencv work in Mac Os El Captain. After some time trying I did It by uninstalling numpy from homebrew and then from pip. It looks like they where in conflict. After that just installed through homebrew and it worked.

brew uninstall numpy
pip uninstall numpy
brew install numpy

If that doesn't try reinstalling python from homebrew and make sure you have xcode command line tools with:

xcode-select --install

Hope it helps.