Reputation: 477
I'm just now reading into cython and I'm wondering if cython compiles imported modules as part of the executable of if you still need to have the modules installed on the target machine to run the cython binary.
Upvotes: 3
Views: 906
Reputation: 7293
The "interface" of a Cython module remains at the Python level. When you import a module in Cython, the module becomes available only at the Python level of the code and uses the regular Python import mechanism.
So:
For "Cython level" code, including the question of "cimporting" module, Cython uses the equivalent of C headers (the .pxd
declaration files) and dynamically loaded libraries to access external code. The .so
files (for Linux, DLL for windows and dylib for mac) need to be present on the target machine.
Upvotes: 2