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

Pyinstaller won't run. "ImportError: DLL load failed" #1840

Closed
jstil003 opened this Issue Feb 26, 2016 · 12 comments

Comments

Projects
None yet
@jstil003

jstil003 commented Feb 26, 2016

I installed pyinstaller 3.1.1 and even tried the 3.2.dev build but neither seem to work. I am on Windows and I have python 3.5 installed. Any time I try to run pyinstaller I receive the following:

C:\Windows\system32>pyinstaller
Traceback (most recent call last):
  File "c:\python35\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python35\Scripts\pyinstaller.exe\__main__.py", line 5, in <module>
  File "c:\python35\lib\site-packages\PyInstaller\__main__.py", line 21, in <mod
ule>
    import PyInstaller.building.build_main
  File "c:\python35\lib\site-packages\PyInstaller\building\build_main.py", line
32, in <module>
    from ..depend import bindepend
  File "c:\python35\lib\site-packages\PyInstaller\depend\bindepend.py", line 42,
 in <module>
    from ..utils.win32.winmanifest import RT_MANIFEST
  File "c:\python35\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", l
ine 97, in <module>
    from PyInstaller.utils.win32 import winresource
  File "c:\python35\lib\site-packages\PyInstaller\utils\win32\winresource.py", l
ine 20, in <module>
    import pywintypes
  File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 124, in <mo
dule>
    __import_pywin32_system_module__("pywintypes", globals())
  File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 64, in __im
port_pywin32_system_module__
    import _win32sysloader
ImportError: DLL load failed: The specified module could not be found.

Is the problem with the _win32sysloader.pyd? If so, I know I have the file located under the following directory: C:\Python35\Lib\site-packages\win32.

@tallforasmurf

This comment has been minimized.

Show comment
Hide comment
@tallforasmurf

tallforasmurf Feb 26, 2016

Contributor

Forgive me for saying the obvious, but have you installed pywin32? It is a requirement for windows.

Contributor

tallforasmurf commented Feb 26, 2016

Forgive me for saying the obvious, but have you installed pywin32? It is a requirement for windows.

@jstil003

This comment has been minimized.

Show comment
Hide comment
@jstil003

jstil003 Feb 26, 2016

@tallforasmurf So I need both pypiwin32 and pywin32 installed? I installed pywin32 now and it doesn't seem to be throwing this error anymore. However, pip installed the pypiwin32 along with pyinstaller, so I assumed this would work since it says to use pypiwin32 or pywin32. Strange that I had already tried installing pywin32 anyway and it didn't appear to work.

jstil003 commented Feb 26, 2016

@tallforasmurf So I need both pypiwin32 and pywin32 installed? I installed pywin32 now and it doesn't seem to be throwing this error anymore. However, pip installed the pypiwin32 along with pyinstaller, so I assumed this would work since it says to use pypiwin32 or pywin32. Strange that I had already tried installing pywin32 anyway and it didn't appear to work.

@tallforasmurf

This comment has been minimized.

Show comment
Hide comment
@tallforasmurf

tallforasmurf Feb 26, 2016

Contributor

You are correct, pip should have installed pypiwin32.

In the above, the PyInstaller module winresource.py imports pywintypes, and that fails.

pywintypes.py appears to be part of the pywin32 package. You say when you installed pywin32, the error stopped happening.

This suggests maybe winresource.py is dependent on pywin32? I don't know if there is supposed to be a compatible pywintypes in the other package.

Contributor

tallforasmurf commented Feb 26, 2016

You are correct, pip should have installed pypiwin32.

In the above, the PyInstaller module winresource.py imports pywintypes, and that fails.

pywintypes.py appears to be part of the pywin32 package. You say when you installed pywin32, the error stopped happening.

This suggests maybe winresource.py is dependent on pywin32? I don't know if there is supposed to be a compatible pywintypes in the other package.

@htgoebel

This comment has been minimized.

Show comment
Hide comment
@htgoebel

htgoebel Feb 28, 2016

Member

Obviously this is not related to PyInstaller, but to your environment: pywintypes fails to import _win32sysloader.

  File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 124, in <module>
    __import_pywin32_system_module__("pywintypes", globals())
  File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 64, in __import_pywin32_system_module__
    import _win32sysloader
ImportError: DLL load failed: The specified module could not be found.

Please check your environment. There is nothing we can do here.

Member

htgoebel commented Feb 28, 2016

Obviously this is not related to PyInstaller, but to your environment: pywintypes fails to import _win32sysloader.

  File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 124, in <module>
    __import_pywin32_system_module__("pywintypes", globals())
  File "c:\python35\lib\site-packages\win32\lib\pywintypes.py", line 64, in __import_pywin32_system_module__
    import _win32sysloader
ImportError: DLL load failed: The specified module could not be found.

Please check your environment. There is nothing we can do here.

@htgoebel htgoebel closed this Feb 28, 2016

@htgoebel htgoebel added the invalid label Feb 28, 2016

@yunchih

This comment has been minimized.

Show comment
Hide comment
@yunchih

yunchih Aug 26, 2016

The solution here might work. I manage to make it work only by manually installing pywin32 from here.

yunchih commented Aug 26, 2016

The solution here might work. I manage to make it work only by manually installing pywin32 from here.

@ondj

This comment has been minimized.

Show comment
Hide comment
@ondj

ondj Sep 5, 2016

@jstil003 Hi. After installing Python 3.5 on clean Windows 7 x86 machine and then run pip install pyinstaller, I got the same error. So I analyze _win32sysloader.pyd dependencies in Dependency Walker and there is a dependency to MSVCR100.DLL file, which is a part of the Microsoft Visual C++ 2010 Redistributable Package. After installing this package, PyInstaller works correctly.

ondj commented Sep 5, 2016

@jstil003 Hi. After installing Python 3.5 on clean Windows 7 x86 machine and then run pip install pyinstaller, I got the same error. So I analyze _win32sysloader.pyd dependencies in Dependency Walker and there is a dependency to MSVCR100.DLL file, which is a part of the Microsoft Visual C++ 2010 Redistributable Package. After installing this package, PyInstaller works correctly.

@matyvico

This comment has been minimized.

Show comment
Hide comment
@matyvico

matyvico Sep 29, 2016

I can confirm that installing Microsoft Visual C++ 2010 Redistributable Package fixed the error. Thank you!

matyvico commented Sep 29, 2016

I can confirm that installing Microsoft Visual C++ 2010 Redistributable Package fixed the error. Thank you!

@paulhauner

This comment has been minimized.

Show comment
Hide comment
@paulhauner

paulhauner Jan 5, 2017

Installing Microsoft Visual C++ 2010 Redistributable Package did not work for me, however the second solution from @yunchih worked for me.

To clarify:

  1. Go to https://sourceforge.net/projects/pywin32/files/pywin32/
  2. Read the instructions at the bottom about choosing the correct installer for your Python version. (I believe the talk about SourceForge's filesystem being "horrible" is no longer relevant.)
  3. Download and install the correct installer for your Python version. Mine was pywin32-220.win-amd64-py3.5.exe

My issues were solved immediately after this, without reboot.

Note: Microsoft Visual C++ 2010 Redistributable Package is installed on my system and is likely a co-dependency.

paulhauner commented Jan 5, 2017

Installing Microsoft Visual C++ 2010 Redistributable Package did not work for me, however the second solution from @yunchih worked for me.

To clarify:

  1. Go to https://sourceforge.net/projects/pywin32/files/pywin32/
  2. Read the instructions at the bottom about choosing the correct installer for your Python version. (I believe the talk about SourceForge's filesystem being "horrible" is no longer relevant.)
  3. Download and install the correct installer for your Python version. Mine was pywin32-220.win-amd64-py3.5.exe

My issues were solved immediately after this, without reboot.

Note: Microsoft Visual C++ 2010 Redistributable Package is installed on my system and is likely a co-dependency.

@t-animal

This comment has been minimized.

Show comment
Hide comment
@t-animal

t-animal Jan 18, 2017

I can confirm this. On a clean Win7 VM installation I, after installing pyinstaller via pip to a virtualenv, still needed to install pywin32 and Microsoft Visual C++ 2010 Redistributable Package.

t-animal commented Jan 18, 2017

I can confirm this. On a clean Win7 VM installation I, after installing pyinstaller via pip to a virtualenv, still needed to install pywin32 and Microsoft Visual C++ 2010 Redistributable Package.

@algorys

This comment has been minimized.

Show comment
Hide comment
@algorys

algorys Feb 27, 2017

Same problem happens to me.

Until I install Microsoft Visual C++ 2010 Redistributable, pywin32 produce an error (DLL not found) at the end of installation. Once the twice install, pyinstaller works.

Note: test on Win Server 2012, Python 3.5.3 x64, pywin32-220.win-amd64-py3.5.exe

algorys commented Feb 27, 2017

Same problem happens to me.

Until I install Microsoft Visual C++ 2010 Redistributable, pywin32 produce an error (DLL not found) at the end of installation. Once the twice install, pyinstaller works.

Note: test on Win Server 2012, Python 3.5.3 x64, pywin32-220.win-amd64-py3.5.exe

@chinue

This comment has been minimized.

Show comment
Hide comment
@chinue

chinue May 5, 2017

copy msvcr100.dll to C:\Windows, then it works

chinue commented May 5, 2017

copy msvcr100.dll to C:\Windows, then it works

@ericfrederich

This comment has been minimized.

Show comment
Hide comment
@ericfrederich

ericfrederich May 30, 2017

I'm having this issue as well with a version of Python I compiled myself with Visual Studio 2012 (required to be able to link against other 3rd party C libraries).

Should MSVC 2010 C++ Redistributable really be a dependency, or just if you're using a version of Python you downloaded from python.org?

ericfrederich commented May 30, 2017

I'm having this issue as well with a version of Python I compiled myself with Visual Studio 2012 (required to be able to link against other 3rd party C libraries).

Should MSVC 2010 C++ Redistributable really be a dependency, or just if you're using a version of Python you downloaded from python.org?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment