LoginSignup
4
2

More than 5 years have passed since last update.

Homebrewで入るPython2.7.12でモジュールをimportしてコケることに対応したメモ

Last updated at Posted at 2016-10-12

検索してもなかなかたどり着けなかったのでメモ

下記の記事を参考に、Macでpythonを設定
[Qiita] MacでPython使う時の最低限のメモ(Homebrew編)

下記の記事と同じようなエラーが出ました
[Qiita]Homebrewで入るPython2.7.11でDjangoのrunserverがコケることに対応したメモ
※私の場合は、バージョン2.7.12で、Djangoではなく適当なモジュールをimportして実行したら出ました

ImportError: dlopen(/usr/local/Cellar/python/2.7.12_2/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.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

下記のコマンドで解決しました

$ hash -r python

hashテーブルの再構築が必要らしい
もしくはターミナルの再起動でも解決するっぽい

参考:http://stackoverflow.com/questions/34386527/symbol-not-found-pycodecinfo-getincrementaldecoder

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2