@Araq, Fiddled around in the generated C file in the **nimcache** directory by adding code to load the library **libpython3.5m.so.1.0** in C directly and it throws the same error!
The added code (added to the generated **PyInit_nim_module** function) is: N_CDECL(..., PyInit_nim_module)(void) { NimMain(); nimln_(171, "nim_module.nim"); void* handle; nimln_(900, "nim_module.nim"); handle = dlopen("libpython3.5m.so.1.0", RTLD_LAZY); nimln_(901, "nim_module.nim"); void (*init)(void) = dlsym(handle, "Py_Initialize"); nimln_(902, "nim_module.nim"); (*init)(); <----------------- ERROR nimln_(903, "nim_module.nim"); dlclose(handle); /* Rest of the code */ } Do you perhaps know why this error occurs when invoking the **dlsym** loaded function? I know this question would probably be better placed in a python forum, but I'm hoping someone knows something about the problem!