top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

DLL load failed when running a python code

0 votes
815 views

I'm new to Python and trying to run a already written code. Can someone please explain the error below? And if possible, how do I resolve this?

Traceback (most recent call last):
 File "c:Project_1regression_1.py", line 7, in  from sklearn import metrics, cross_validation, linear_model
 File "c:Python27libsite-packagessklearnmetrics__init__.py", line 31, in from . import cluster
 File "c:Python27libsite-packagessklearnmetricscluster__init__.py", line 8, in 
 from .supervised import adjusted_mutual_info_score
 File "c:Python27libsite-packagessklearnmetricsclustersupervised.py", line 19, in 
 from .expected_mutual_info_fast import expected_mutual_information
 File "expected_mutual_info_fast.pyx", line 10, in init sklearn.metrics.cluster
.expected_mutual_info_fast (sklearnmetricsclusterexpected_mutual_info_fast.c: 4886)
 File "c:Python27libsite-packagesscipyspecial__init__.py", line 529, in <module>
 from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
posted Jul 1, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

This particular module incorporates FORTRAN subroutines. My guess is that whoever compiled your scipy binary did it in such a way that the FORTRAN standard library was being linked in as a DLL instead of statically. This DLL is not present on your system. Windows is trying to find it, but failing.

How did you install scipy? If you used a prebuilt binary installer, can you please link to the exact one that you used?

Try using depends.exe to find out what DLL it is looking for. http://www.dependencywalker.com/

The file that you want to check in depends.exe: c:Python27libsite-packagesscipyspecial_ufuncs.pyd

answer Jul 1, 2013 by anonymous
0 votes

You're missing the dll that provides some function that you're trying to use.

answer Jul 1, 2013 by anonymous
Similar Questions
+2 votes

I have started looking into distutils because I need to write an extension module in C (for performance reasons) and distutils seems to be the most straight-forward way.

I have had success building a C file into a Python extension module using "python setup.py build" but I am wondering what the recommended way for using that module during development is. While writing Python code I am used to just run the code from the source directory. But the built extension modules .so of course does not just end up on sys.path magically.

So how do I run my code so it will find the built extension module? Do I pass the output directory on the command line manually or is there some other solution? I would like to still be able to run the code from the source directory as I am using PyCharm to edit and debug the code.

0 votes

After a user selects a file from the form, that selection of his can be found form reading the variable 'filename'

If the filename already exists in to the database i want to update its counter and that is what i'm trying to accomplish by:

if form.getvalue('filename'):
 cur.execute('''UPDATE files SET hits = hits + 1, host = %s, lastvisit = %s WHERE url = %s''', (host, lastvisit, filename) )

For some reason this never return any data, because for troubleshooting i have tried:

data = cur.fetchone()

if data:
 print("something been returned out of this"_

Since for sure the filename the user selected is represented by a record inside 'files' table why its corresponding counter never seems to get updated?

0 votes

I would like to use the Gen3.dll functions from python. I understand that I can use ctypes to load the dll. I have been able to load the dll but cannot make any sense of how to use it once I have it loaded. I have been trying to understand the ctypes tutorial but I just can't wrap my head around it. I have attached a zip file of everything I have about the dll, including the Gen3.dll. Can someone point me in the right direction. My hopes are that I can automate the functions to provide a test program. The Gen3.dll communicates to a piece of hardware over a USB cable. Its mainly for setting voltages and loads and reading results.

0 votes

Im required to import ha certain dll called 'NHunspell.dll' which is used for Spell Checking purposes. I am using Python for the software. Although I checked out several websites to properly use ctypes, I have been unable to load the dll properly.

When I use this code.

 from ctypes import *
 hunspell = cdll.LoadLibrary['Hunspellx64.dll']

I get an error

 hunspell = cdll.LoadLibrary['Hunspellx64.dll']
 TypeError: 'instancemethod' object has no attribute '__getitem__'

I guess it might a problem with the structure of the dll. But I have no idea how to import the dll properly.

...