I've been stuck at this problem for a while now. I'm currently creating an extension module for Python called simulations. This extension is written in C++. For this extension, I needed to use the gsl library, and link it in my setup.py file. For some reason, if I don't link to the library in libraries, library_dirs, the code doesn't work because it's missing libraries, but if I do, I get the error ImportError: DLL load failed while importing simulations: The specified module could not be found. I'm not sure if they're related at all, but if I run the program without gsl, it works fine.
This is my setup.py:
my tasks.json
Both setup.py build and install don't give any errors - they run as usual. Not sure why suddenly getting this error, but it's frustrating! Any help is appreciated! I've never built an extension before :)
Thanks,
Hana
Hello,I've been stuck at this problem for a while now. I'm currently creating an extension module for Python called simulations. This extension is written in C++. For this extension, I needed to use the gsl library, and link it in my setup.py file. For some reason, if I don't link to the library in libraries, library_dirs, the code doesn't work because it's missing libraries, but if I do, I get the error ImportError: DLL load failed while importing simulations: The specified module could not be found. I'm not sure if they're related at all, but if I run the program without gsl, it works fine.
Hey mattip,I'm not sure if my last message got posted, so I'm rewriting this one.Thank you so much for your response! I've only been working with this for ~2 weeks, but I've already learnt so much about compilers/linkers/etc., and it's really fun :) My problem's actually gotten worse somehow - instead of working without gsl, now the program doesn't work at all. I keep getting the error ImportError: DLL load failed while importing simulations: The specified module could not be found. Following the post above, I checked for the dependent DLLs using lucasg's Dependencies, and noticed I had 2 missing (python311.dll and gsl.dll), which I then added to my PATH.
Hey mattip,