0

I followed the instructions at https://gist.github.com/2778301 but when I try to do import PythonMagick I get the error message:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "PythonMagick/__init__.py", line 1, in <module>
    from . import _PythonMagick
ImportError: cannot import name _PythonMagick

The PythonMagick.so is in my python2.7 site-packages.

EDIT: I solved this problem by copying from where make install installed PythonMagick /usr/local/lib/python2.7/site-packages/PythonMagick to where Python actually looks on a OS X Lion, /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

user1443362
  • 645
  • 1
  • 11
  • 15

1 Answers1

2

There's an answer to your question on the link you provided:

This can be fixed by changing the first line of __init__.py in PythonMagick, which is usually found in the site-packages directory, for instance,

python2.7/site-packages/PythonMagick

Try changing:

from . import _PythonMagick

to

import _PythonMagick
David C
  • 7,204
  • 5
  • 46
  • 65