title: Pyinstaller - WindowsError: [Error 126] The specified module could not be found
body: <p>Hello learned readers,</p>
  
  <p>I'm having some trouble creating an exe using pyinstaller, whereby during run time, I'm receiving the error message:</p>
  
  <pre><code>  File "&lt;string&gt;", line 17, in &lt;module&gt;
    File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.geometry", line 4, in &lt;module&gt;
    File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.geometry.base", line 9, in &lt;module&gt;
    File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.coords", line 8, in &lt;module&gt;
    File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.geos", line 15, in &lt;module&gt;
    File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.libgeos", line 184, in &lt;module&gt;
    File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\ctypes", line 365, in __init__
  WindowsError: [Error 126] The specified module could not be found
  </code></pre>
  
  <p>As far as I know, this is a dll problem. However it does not specify which once is causing the problem. I've debugged using --log-level=debug and pasted this below. I've also checked the warning message from pyinstaller and haven't been able to discern the cause of the error.</p>
  
  <p>Any thought of suggestions as to what could be causing this error?</p>
  
  <p>Many thanks</p>
  
  <p>Snip taken from the output of the buildtime: </p>
  
  <pre><code>24094 INFO: Adding Microsoft.VC90.MFC to dependent assemblies of final executable
  24222 INFO: Searching for assembly x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
  24223 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86.manifest
  24223 INFO: Searching for file mfc90.dll
  24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfc90.dll
  24225 INFO: Searching for file mfc90u.dll
  24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfc90u.dll
  24225 INFO: Searching for file mfcm90.dll
  24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfcm90.dll
  24225 INFO: Searching for file mfcm90u.dll
  24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfcm90u.dll
  26147 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_none ...
  26147 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57.manifest
  26148 INFO: Searching for file msvcr90.dll
  26148 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll
  26148 INFO: Searching for file msvcp90.dll
  26148 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll
  26149 INFO: Searching for file msvcm90.dll
  26149 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcm90.dll
  26516 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  27055 INFO: Using Python library C:\Windows\system32\python27.dll
  27253 INFO: Warnings written to C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\warngis_helper2.txt
  27286 INFO: checking PYZ
  27286 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
  27286 INFO: building PYZ (ZlibArchive) out00-PYZ.toc
  33585 INFO: checking PKG
  33585 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
  33585 INFO: building PKG (CArchive) out00-PKG.pkg
  60197 INFO: checking EXE
  60197 INFO: rebuilding out00-EXE.toc because GIS_Helper.exe missing
  60197 INFO: building EXE from out00-EXE.toc
  60202 INFO: Appending archive to EXE C:\Users\Hp\PycharmProjects\GISdev\dist\GIS_Helper.exe
  </code></pre>