Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowsError: [Error 126] The specified module could not be found #9

Open
artyak opened this issue Jan 4, 2013 · 10 comments
Open

WindowsError: [Error 126] The specified module could not be found #9

artyak opened this issue Jan 4, 2013 · 10 comments

Comments

@artyak
Copy link

artyak commented Jan 4, 2013

Hi there,

I'm new to python but I saw your module for GoogleEarth and really really want to use it. I've managed to install the module but am struggling to complete the examples. I just have a few quick questions and I would really appreciate any kind of help or advice for how to get the .kml output to display.
These first two parts work fine:

import heatmap
import random

then i get to

hm = heatmap.Heatmap()

and I get the error message "WindowsError: [Error 126] The specified module could not be found"

From looking around online apparently there could be an issue with the location of the .dll? I also saw there was a previous issue dealing with "from heatmap import Heatmap"...is that related?

Honestly I'm not even sure if I should be working in the windows command line or in IDLE.

I really think this module can do exactly what I need (creating a crime density overlay) so I'm not ready to give up. Help please!

@jjguy
Copy link
Owner

jjguy commented Jan 22, 2013

aterr06, there was a bug with pip / easy_install in v2.2 that caused similar behavior. Try installing from the zip file using setup.py:

cd heatmap-2.2.1
python setup.py install

@jjguy jjguy closed this as completed Jan 22, 2013
@zerostress
Copy link

Hi,
the problem persists using heatmap v. 2.2.1. Any suggestion to solve it?

My SO: Windows 7
Python 2.7.3
PIL 1.1.7

@prolixe
Copy link

prolixe commented Mar 10, 2013

Hi, I also have the same problem. My setup is similar to zerostress, excepted that I tried both PIL and Pillow, with no results. I also tried previous heatmap versions (2.2 and 2.0), and the problem persist. I also installed heatmap with python setup.py install.

Here is the error message.

hm = heatmap.Heatmap()
File "C:\Python27\lib\site-packages\heatmap\heatmap.py", line 73, in init
os.path.join(d, libname))
File "C:\Python27\lib\ctypes__init__.py", line 443, in LoadLibrary
return self.dlltype(name)
File "C:\Python27\lib\ctypes__init
_.py", line 365, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] Le module spécifié est introuvable

I don't know if the above could be useful, I'm still a beginner at Python. Thank you for your help.

@zerostress
Copy link

Hi Prolixe,
i've solved the problem recompiling the dll using the heatmap.c source code and overwriting the old dlls...
Hope this helps you.

@prolixe
Copy link

prolixe commented Mar 12, 2013

It worked, thank you very much.

@xiachaolun
Copy link

Hi Prolixe,

Could you please give more instruction on which dll we need to recompile? Thanks a lot.

@jjguy
Copy link
Owner

jjguy commented Jul 23, 2013

It looks like the pre-compiled DLLs have a dependency on a DLL that's not on your system.

That code path is here:

 61             libname = "cHeatmap.so"
 62             if "cygwin" in platform.system().lower():
 63                 libname = "cHeatmap.dll"
 64             if "windows" in platform.system().lower():
 65                 libname = "cHeatmap-x86.dll"
 66                 if "64" in platform.architecture()[0]:
 67                     libname = "cHeatmap-x64.dll"
 68             # now rip through everything in sys.path to find 'em.  Should be in site-packages
 69             # or local dir
 70             for d in sys.path:
 71                 if os.path.isfile(os.path.join(d, libname)):
 72                     self._heatmap = ctypes.cdll.LoadLibrary(
 73                         os.path.join(d, libname))

If you're getting to the LoadLibrary() call, it chose a libname, found it in sys.path, passed the os.isfile() conditional but failed with 126 in LoadLibrary.

Since we know the DLL is there thanks to os.isfile(), it must be the missing dependency of that DLL. The Visual Studio build "script" is here:

https://github.com/jjguy/heatmap/blob/master/build.bat

They were built with VS2012 on a Windows 7 box. What OS are you running from?

@jjguy jjguy reopened this Jul 23, 2013
@Difool-gc
Copy link

Hi

I have the same error as Prolixe ( #9 (comment) )

hm = heatmap.Heatmap()
  File "C:\Program Files (x86)\Python27-32\lib\site-packages\heatmap\heatmap.py", line 73, in **init**
    os.path.join(d, libname))
  File "C:\Program Files (x86)\Python27-32\lib\ctypes__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "C:\Program Files (x86)\Python27-32\lib\ctypes__init__.py", line 365, in **init**
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] Det angivne modul blev ikke fundet

My OS is Win7 Home Premium 64-bit, and my Python installed is is "Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32", Python is 32-bit because I could only get the install for PIL to work on 32-bit Python.

@Difool-gc
Copy link

Resolved from the advise here I installed VC++ 2012 redist and ran the build.bat and I could run the example code without the error.

Note. I don't know if it was necessary to run build.bat first.

@anapt
Copy link

anapt commented May 8, 2017

Hello,

I am trying to run the example code and even though it worked alright the first time I run the code, now it has stopped working.
I've tried some of the previous solutions, but none of them seems to work on my system.
I am using Ubuntu 16.04 and Python 2.7.

Moreover, when I try to recompile the dll files as zerostress suggested, I get an "unresolved reference to main" error.

Any suggestions on how to overcome this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants