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