Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DLL load failed: The specified module could not be found PYTHON

I'm trying to import a module (UHD) into Python 2.7 from a network location. Whenever I do the import I get the following error:

ImportError: DLL load failed: The specified module could not be found

The initial import calls an init.py script that imports the other libraries. The first library import in the init script throws this error at the following line, which is also the first line of code within that file:

from . import libpyuhd as lib

libpyuhd is a .pyd file in the same directory as other files for this module.

The interesting thing is that I can import this fine from one computer (specifically the computer I built the module from source on) but when I try to run from another computer it fails.

The python executable is also stored at the network location along with the all the code I am trying to run. The only thing used in the build that isn't on the network drive is Visual Studio.

Does this error mean it can't find the .pyd file or that it can find the .pyd file but fails to import something from it?

Thank you.

like image 595
b.collins Avatar asked Mar 07 '26 12:03

b.collins


1 Answers

I just solved this problem so may be able to help.

This ImportError: DLL load failed error meanslibpyuhd is not able to find a dependent library.

What is best is to install the Dependency Walker utility and open libpyuhd in that. It takes a few minutes to analyze all the stuff and will list all the dependent libraries and those that cannot be found comes up with a question mark.

In my case, it showed the boost python library to be missing, though I had already installed it. I just added the path to the missing library to PATH environment variable and valla! It works now.

[An example screenshot of dependency walker:[1]

like image 136
Nikhil Dev A Avatar answered Mar 09 '26 01:03

Nikhil Dev A