This makefile has
transcendentals.so: setup.py transcendentals.pyx
python setup.py build_ext --inplace
If it pythonrefers to /Users/spacegoing/anaconda/bin/python3, it should be replaced, since the module can be compiled for the wrong version of python and cannot be loaded.
main.c import_transcendentals(), , .. . get_pi() get_e() , .
, - , . , python. PYTHONPATH , , transcendentals.so.
C , .
, PyInit_transcendentals() .
transcendentals.h , cython public i.e.
cdef public api double get_pi():
...
cdef public api double get_e():
main.c include
#include <Python.h>
#include "transcendentals.h"
main
Py_Initialize();
PyInit_transcendentals();
#include "transcendentals_api.h" no import_transcendentals()
,
, modulename.h, modulename_api.h C, , .
, transcendentals.c
gcc $(cflags) $(ldflags) transcendentals.c main.c
. , PyInit_transcendentals() Python 3