LoginSignup
0
0

More than 5 years have passed since last update.

pillow を使って from PIL import Image した時に Symbol not found: _PyUnicodeUCS2_AsLatin1String とか出る時の対応

Posted at

またエラー引きそうなので、自分用のメモも含めて。

環境

Homebrewでインストールしたpyenv上で動かしています。

python2.7.12
Pillow2.7.0

事象

importでコケる

>>> from PIL import Image
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/PIL/Image.py", line 63, in <module>
    from PIL import _imaging as core
ImportError: dlopen(/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/PIL/_imaging.so, 2): Symbol not found: _PyUnicodeUCS2_AsLatin1String
  Referenced from: /usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/PIL/_imaging.so
  Expected in: flat namespace
 in /usr/local/var/pyenv/versions/2.7.12/lib/python2.7/site-packages/PIL/_imaging.so

対処

これで直った

$ pip freeze | pip install --ignore-installed --no-use-wheel -r /dev/stdin

ここに詳しく書いてある
Import Error on El Capitain · Issue #1753 · python-pillow/Pillow

0
0
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
0
0