Symbol not found: __PyCodecInfo_GetIncrementalDecoder

后端 未结 12 543
借酒劲吻你
借酒劲吻你 2020-11-30 01:18

Since updating from Homebrew Python 2.7.11 (from 2.7.10) I\'m suddenly unable to test register my package on PyPi from the PyCharm IDE console.

Running (as an \"Exte

相关标签:
12条回答
  • 2020-11-30 01:39

    I had the same issue when I tried to use PyCharm. Solved by setting "python interpreter" in project configuration to point to the python virtual env I wanted to use, which was an Anaconda env. Somehow the interpreter path was missing the "anaconda" portion of ~/.../anaconda/.../_io.so. No need to uninstall anaconda.

    0 讨论(0)
  • 2020-11-30 01:40

    Can't add comment (?) so this just to share my exp., downgrade to 2.7.10 works fr me.

    0 讨论(0)
  • 2020-11-30 01:42

    Reinstall python.

    brew unlink python && brew reinstall python
    

    Secure the path

    export PYTHONPATH=$PYTHONPATH:/usr/local/bin/
    

    BACKUP and Change the order of "paths" file.

    sudo nano /etc/paths
    

    it seems, the order of paths, it is decisive to run python properly. In my case, the result was:

    #sudo nano /etc/paths
      /usr/bin  
      /usr/local/bin
      /bin
      /usr/sbin
      /sbin
    

    On my mac, path is like this.

    $ which python
        /usr/local/bin/python
    

    Now I can run both:

    $ /usr/local/bin/python -c "import io"
    $ python -c "import io"
    
    0 讨论(0)
  • 2020-11-30 01:46

    I got this error after a failed NLTK download, I needed to uninstall anaconda:

    sudo rm -rf ~/anaconda 
    update PATH variable
    
    0 讨论(0)
  • 2020-11-30 01:47

    I had the same issue, it is successfully fixed by just replacing the _io.so file.

    sudo find / -name _io.so
    

    copy the path of the _io.so file which DOES NOT belong to python-2.7.11. For example, copy the path of _io.so which is under python-2.7.5: /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

    Replace the /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so file with the _io.so that you just found.

    0 讨论(0)
  • 2020-11-30 01:49

    According to https://github.com/klen/python-mode/issues/634:

    I had the same issue, but successfully fixed. In my case I compiled python and vim with homebrew, when PYTHON_PATH has been specified and set to one of my dev environments, where I also had some libraries, including io. Workaround was simple: open new terminal, make sure that you do not have custom PYTHON_PATH, uninstall python, uninstall vim. Reinstall both of them.

    and

    Problem solved.

    Culprit is the update from python 2.7.10 to 2.7.11.

    If you are using conda package control, simply run "conda install python=2.7.10" will solve this problem.

    This doesn't give the root cause though. Since this happens with _io, this looks like a bug in python 2.7.11 (unlikely, there would be a world-scale outcry and a prompt fix if it was) or some packaging bug or version mismatch specifically with the homebrew version (and maybe some related ones, too).

    Try to import _io in the console and if it succeeds, check if it was loaded from the same path.

    0 讨论(0)
提交回复
热议问题