Cython and PyCharm - error which does not occur in Python from Terminal

Hi everyone, I have a very weird error during import of a compiled cython function. I say weird because everything works just fine if I use python from Terminal instead of Pycharm console. Here is the error:

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/(me)/Analysis/analysis.py", line 8, in <module>
from cfunctions import Cpotts_energy
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: dlopen(/Users/(me)/Analysis/cfunctions.so, 2): Symbol not found: _PyCapsule_New
Referenced from: /Users/(me)/Analysis/cfunctions.so
Expected in: flat namespace
in /Users/(me)/Analysis/cfunctions.so

The C function is just an easy array sum, but as I said no errors occur using python from Terminal, so I guess PyCharm itself might be involved in some obscure setup that exceeds from my newbie knowledge.

Mac OS 10.11.1, Python 2.7.3

Any clues? Thanks in advice

Lorenzo

Please sign in to leave a comment.