Import C-Library in python klappt nicht
-
Hi Leute,
ich hab ein Problem und zwar baue ich mir eine C-Library per CMake und zwar so:
CMakeLists.txtset(cache hellomodul.c ) add_library(hello SHARED ${cache}) set_target_properties(hello PROPERTIES PREFIX "") install(TARGETS hello RUNTIME DESTINATION bin LIBRARY DESTINATION lib )
So jetzt versuche ich diese in Python zu benutzen. Dann kommt aber immer:
Traceback (most recent call last): File "<string>", line 6, in <module> ImportError: No module named hello
Die Dateien liegen alle in einem Ordner.
Dann hab ich noch mal probiert per Konsole in den Ordner dort per Befehl "python" Python gestartet und
import hello
eingegeben. Funktioniert und läuft auch mit der gebauten Lib.
python Datei:#DRV_NAME HUTHPOS #DRV_VENDOR xqand #DRV_VERSION 0.1 print "HALLO" import hello as hi hi.printHello hi.printHello()
Aufgerufen wird das ganze bei mir per
Py_Initialize(); PySys_SetArgv(argc, argv); PyRun_SimpleString(driver->getDriver()); Py_Finalize();
-
Hab das Problem gelöst aber ganz anders...
Danke fürs lesen.