apadana
apadana

Reputation: 14640

python getting Symbol not found: __PyCodecInfo_GetIncrementalDecoder

I am trying to use selenium in python and I am getting the following error: Symbol not found: __PyCodecInfo_GetIncrementalDecoder

>>> from selenium import webdriver
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/selenium/__init__.py", line 18, in <module>
    from selenium import selenium
  File "/usr/local/lib/python2.7/site-packages/selenium/selenium.py", line 25, in <module>
    import httplib as http_client
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 80, in <module>
    import mimetools
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mimetools.py", line 6, in <module>
    import tempfile
  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
>>>

OSX 10.11.1 python 2.7.10

I can't figure out if this is an El Capitan issue, python issue. Tried brew doctor and system is ready.

Upvotes: 1

Views: 4725

Answers (2)

Rex L
Rex L

Reputation: 341

This problem is most probably caused by Brew Installed python.

The python official website provides downloads for macOS, you should download and install the official package.

The official installer will fix the python link automatic, then issue solved.

Upvotes: 0

apadana
apadana

Reputation: 14640

It turned out it was a python issue, after installing a new version of python. Running this solved the issue:

hash -r python

Upvotes: 6

Related Questions