WindowsError: [Error 126] The specified module could not be found
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!
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
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
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.
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.
It worked, thank you very much.
Hi Prolixe,
Could you please give more instruction on which dll we need to recompile? Thanks a lot.
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?
Hi
I have the same error as Prolixe ( https://github.com/jjguy/heatmap/issues/9#issuecomment-14686857 )
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.
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.
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?