windows10 pyinstaller can't find python37.dll

245 views
Skip to first unread message

aardvarkkrill

unread,
Jul 16, 2019, 10:37:45 AM7/16/19
to PyInstaller
I'm trying to compile a one-line hello-world program with pyinstaller on windows10.  (I had no trouble on ubuntu)
code: test.py:
print('test ok')

The application directory and .exe is built successfully, but on execution it cannot find python37.dll.

Any help gratefully received, thanks.

Transcript:
PS C:\tmp> pyinstaller.exe .\test.py
46 INFO: PyInstaller: 3.5
46 INFO: Python: 3.7.3
46 INFO: Platform: Windows-10-10.0.17134-SP0
46 INFO: wrote C:\tmp\test.spec
46 INFO: UPX is not available.
62 INFO: Extending PYTHONPATH with paths
['C:\\tmp', 'C:\\tmp']
62 INFO: checking Analysis
62 INFO: Building because C:\tmp\test.py changed
62 INFO: Initializing module dependency graph...
62 INFO: Initializing module graph hooks...
62 INFO: Analyzing base_library.zip ...
2421 INFO: running Analysis Analysis-00.toc
2421 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\program files (x86)\python37-32\python.exe
3436 INFO: Caching module hooks...
3452 INFO: Analyzing C:\tmp\test.py
3452 INFO: Loading module hooks...
3452 INFO: Loading module hook "hook-encodings.py"...
3530 INFO: Loading module hook "hook-pydoc.py"...
3530 INFO: Loading module hook "hook-xml.py"...
3733 INFO: Looking for ctypes DLLs
3733 INFO: Analyzing run-time hooks ...
3749 INFO: Looking for dynamic libraries
5498 INFO: Looking for eggs
5498 INFO: Using Python library c:\program files (x86)\python37-32\python37.dll
5498 INFO: Found binding redirects:
[]
5498 INFO: Warnings written to C:\tmp\build\test\warn-test.txt
5545 INFO: Graph cross-reference written to C:\tmp\build\test\xref-test.html
5561 INFO: checking PYZ
5561 INFO: Building because toc changed
5561 INFO: Building PYZ (ZlibArchive) C:\tmp\build\test\PYZ-00.pyz
6045 INFO: Building PYZ (ZlibArchive) C:\tmp\build\test\PYZ-00.pyz completed successfully.
6045 INFO: checking PKG
6045 INFO: Building because C:\tmp\build\test\PYZ-00.pyz changed
6045 INFO: Building PKG (CArchive) PKG-00.pkg
6061 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
6061 INFO: Bootloader c:\program files (x86)\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
6061 INFO: checking EXE
6061 INFO: Rebuilding EXE-00.toc because pkg is more recent
6061 INFO: Building EXE from EXE-00.toc
6061 INFO: Appending archive to EXE C:\tmp\build\test\test.exe
6092 INFO: Building EXE from EXE-00.toc completed successfully.
6092 INFO: checking COLLECT
WARNING: The output directory "C:\tmp\dist\test" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
58095 INFO: Removing dir C:\tmp\dist\test
58095 INFO: Building COLLECT COLLECT-00.toc
58251 INFO: Building COLLECT COLLECT-00.toc completed successfully.
PS C:\tmp> .\build\test\test.exe
Error loading Python DLL 'C:\tmp\build\test\python37.dll'.
LoadLibrary: The specified module could not be found.
PS C:\tmp> dir .\build\test\


    Directory: C:\tmp\build\test


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       16/07/2019     15:00                localpycos
-a----       16/07/2019     15:06          14704 Analysis-00.toc
-a----       16/07/2019     15:06         782691 base_library.zip
-a----       16/07/2019     15:07           1371 COLLECT-00.toc
-a----       16/07/2019     15:06           1974 EXE-00.toc
-a----       16/07/2019     15:06        1177474 PKG-00.pkg
-a----       16/07/2019     15:06            924 PKG-00.toc
-a----       16/07/2019     15:06        1161961 PYZ-00.pyz
-a----       16/07/2019     15:06          13269 PYZ-00.toc
-a----       16/07/2019     15:06        1421698 test.exe
-a----       16/07/2019     15:06           1027 test.exe.manifest
-a----       16/07/2019     15:06           2673 warn-test.txt
-a----       16/07/2019     15:06         282311 xref-test.html


Nico Zanferrari

unread,
Jul 18, 2019, 9:01:58 AM7/18/19
to PyInstaller
Hi  andrkay,

the problem is quite simple: you're looking at the wrong .EXE ;-)

I've reproduced it:

C:\tmp>.\build\test\test.exe
Error loading Python DLL 'C:\tmp\build\test\python37.dll'.
LoadLibrary: The specified module could not be found.

C:\tmp>.\dist\test\test.exe
test ok

Cheers,
Nico

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To post to this group, send email to pyins...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyinstaller.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/1e55c3f6-13a1-4eec-8f42-59e9eb2b0891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

aardvarkkrill

unread,
Jul 19, 2019, 7:04:47 AM7/19/19
to PyInstaller
ohhhh how foolish I feel!  Thank you very much for making me a bit wiser. :-)
Andrew

Robert Gottesman

unread,
Jul 22, 2019, 5:28:28 AM7/22/19
to PyInstaller
So, that makes two of us (and this is after I've used the program many times!)
Reply all
Reply to author
Forward
0 new messages