I'm writing a program in python that simulates the reaction of particles, with the aim of teaching the user about particle reactions. As python was too slow at doing the necessary processing, I turned to Cython for speed gains and it worked a treat. I can compile my .pyx
file into a .pyd
file that can be imported and run from python with a simple import
statement (i.e. "import module").
However, the program eventually has to run on another person's computer, and on this computer, the .pyd
file will not import. When I try I get this error message:
"ImportError: DLL load failed: The specified module could not be found."
The .pyd
file is in exactly the same location on both computers, however, I am running python 3.6 while the other computer has python 3.3 installed. Also, my computer has Cython installed while the other computer does not. Both machines are 32-bit.
I cannot simply compile the entire program to a .exe
file as the other computer has a block on .exe
files.
I have trawled through stack's questions on Cython, and have also studied the Cython documentation, all to no avail.
Can someone explain to me why the import isn't working, and how I can get it to work? Some extra background on exactly what .pyd
files are and how python calls them would also be nice.
EDIT: I run the program from a file called main.py . In the same directory, I have a folder called main, which stores the code I use in modules. main.py calls PageManager.py, which calls ParticleModel.py, which calls MoveParticles.pyd. (These three files are stored in the folder main). I use the statement
"import main.MoveParticles"
to import the .pyd file, which works on my computer.