0

I have compiled a few Fortran codes in Python using f2py (windows 10). The compilation was successful, but when I try to import the module, it gives the error:

ImportError: DLL load failed while importing exsnow: The specified module could not be found.

Here 'exsnow' is the name of the module I am trying to import.

I have tried a few things till now by browsing through this site:

(1) copying '.dll' file to the same directory as '.pyd' file as suggested here.

(2) compiling the fortran code with '-static' flag as mentioned in this same post.

The first solution simply did not work as it gives the same dll error. But I am not sure if I have done it properly.

The second solution gives error during compilation:

Don't know how to compile -static

Is there anything else I could to make it work?

The command that I used to compile the code is as follows:

 f2py -c -m exsnow exsnow19.f PACK19.f

Directory structure of the complied module is as follows:

snow19
   | exsnow/.libs/*.dll
   | '*.pyd'

The command that I use to import the module is:

import snow19.exsnow as snow17
 
Abhinav Gupta
  • 187
  • 1
  • 9

0 Answers0