Difficulty running unit test that calls a module with cython
I have a miniconda setup where I am developing code that uses a library containing some cython. We use the source code of the library because we had to modify a few things, but we haven't touched the cython part. My collaborator has things running in a Pycharm environment on linux with no problem. I am trying to set up the same situation on my Mac (Maverick). At first when I had just the Pycharm CE, the editor showed an error on the import statements where the imported file had the .pyx extension. Once I got a professional subscription, that was fixed, so now the editor shows no error on those import statements. But when I try to run the unit test, I am still getting the error.
ImportError: cannot import name 'mle_trev'
What else can I try?
Please sign in to leave a comment.
Only PyCharm Professional Edition supports smart editing and code insight features for Cython files.
This ImportError is a run-time error not related to editing capabilities of PyCharm. PyCharm doesn't offer any features to automate compilation of Cython modules besides its ability to run setup.py commands. It's likely that you haven't compiled / installed your library code. Cython extensions require a compilation step, often it's python setup.py build_ext --inplace or some other library-specific command. Please consult the documentation or the source code of your library.