I always have used pyinstaller to create executables files but now when on working on a older project I am facing some issues.
I have figured out that the main problem is while importing pyreadstat package. (pyreadstat is a python package to read spss files.)
import pyreadstat
Post running pyinstaller it first gives error for Module not found pandas. To resolve this I added --hidden-import pandas then it gave another error about Module not found pyreadstat._readstat_writer.
Once I added that as hidden import I got Module not found worker.
I am now not sure why pyinstaller is behaving in this way. Earlier it used to work correctly.
Can someone provider their input here. Below is the cmd log for reference.
D:\Projects\Test>pyinstaller --onefile test.py
62 INFO: PyInstaller: 4.1
62 INFO: Python: 3.9.1
62 INFO: Platform: Windows-10-10.0.19041-SP0
62 INFO: wrote D:\Projects\Test\test.spec
62 INFO: UPX is not available.
69 INFO: Extending PYTHONPATH with paths
['D:\\Projects\\Test', 'D:\\Projects\\Test']
69 INFO: checking Analysis
69 INFO: Building Analysis because Analysis-00.toc is non existent
69 INFO: Initializing module dependency graph...
69 INFO: Caching module graph hooks...
85 INFO: Analyzing base_library.zip ...
1941 INFO: Processing pre-find module path hook distutils from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
1941 INFO: distutils: retargeting to non-venv dir 'c:\\program files\\python39\\lib'
3458 INFO: Caching module dependency graph...
3552 INFO: running Analysis Analysis-00.toc
3552 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\program files\python39\python.exe
3599 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\program files\python39\python39.dll
3615 INFO: Analyzing D:\Projects\Test\test.py
3630 INFO: Processing module hooks...
3630 INFO: Loading module hook 'hook-difflib.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3630 INFO: Excluding import of doctest from module difflib
3630 INFO: Loading module hook 'hook-distutils.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3630 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3630 INFO: Excluding import of lib2to3.refactor from module distutils.util
3630 INFO: Loading module hook 'hook-encodings.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3703 INFO: Loading module hook 'hook-heapq.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3703 INFO: Excluding import of doctest from module heapq
3703 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3828 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3828 INFO: Excluding import of test.support from module multiprocessing.util
3828 INFO: Excluding import of test from module multiprocessing.util
3844 INFO: Loading module hook 'hook-pickle.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3844 INFO: Excluding import of argparse from module pickle
3844 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3844 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3844 INFO: Loading module hook 'hook-xml.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3891 INFO: Loading module hook 'hook-_tkinter.py' from 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
4006 INFO: checking Tree
4006 INFO: Building Tree because Tree-00.toc is non existent
4021 INFO: Building Tree Tree-00.toc
4085 INFO: checking Tree
4085 INFO: Building Tree because Tree-01.toc is non existent
4085 INFO: Building Tree Tree-01.toc
4180 INFO: checking Tree
4180 INFO: Building Tree because Tree-02.toc is non existent
4180 INFO: Building Tree Tree-02.toc
4196 INFO: Looking for ctypes DLLs
4211 INFO: Analyzing run-time hooks ...
4211 INFO: Including run-time hook 'c:\\program files\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
4211 INFO: Looking for dynamic libraries
4446 INFO: Looking for eggs
4446 INFO: Using Python library c:\program files\python39\python39.dll
4446 INFO: Found binding redirects:
[]
4446 INFO: Warnings written to D:\Projects\Test\build\test\warn-test.txt
4477 INFO: Graph cross-reference written to D:\Projects\Test\build\test\xref-test.html
4524 INFO: checking PYZ
4524 INFO: Building PYZ because PYZ-00.toc is non existent
4524 INFO: Building PYZ (ZlibArchive) D:\Projects\Test\build\test\PYZ-00.pyz
4883 INFO: Building PYZ (ZlibArchive) D:\Projects\Test\build\test\PYZ-00.pyz completed successfully.
4899 INFO: checking PKG
4899 INFO: Building PKG because PKG-00.toc is non existent
4899 INFO: Building PKG (CArchive) PKG-00.pkg
6528 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
6528 INFO: Bootloader c:\program files\python39\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
6528 INFO: checking EXE
6528 INFO: Building EXE because EXE-00.toc is non existent
6528 INFO: Building EXE from EXE-00.toc
6528 INFO: Appending archive to EXE D:\Projects\Test\dist\test.exe
6700 INFO: Building EXE from EXE-00.toc completed successfully.
D:\Projects\Test>cd dist
D:\Projects\Test\dist>test.exe
Traceback (most recent call last):
File "test.py", line 1, in <module>
File "c:\program files\python39\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pyreadstat\__init__.py", line 17, in <module>
File "pyreadstat\pyreadstat.pyx", line 1, in init pyreadstat.pyreadstat
File "pyreadstat\_readstat_parser.pyx", line 28, in init pyreadstat._readstat_parser
ModuleNotFoundError: No module named 'pandas'
[10584] Failed to execute script test
Related
Environment:
Windows 10
PyInstaller: 5.2
Python: 3.10.5
opencv-python 4.6.0.66
Problem:
I am trying to compile my Python code with PyInstaller. The exe is created and when I execute it, I get this error message:
Traceback (most recent call last):
File "PhoneBot.py", line 343, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "modules\prepare_envir_appium.py", line 24, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "modules\mymodulesteam.py", line 13, in <module>
File "C:\Users\gauth\AppData\Local\Temp\_MEI40002\cv2\__init__.py", line 181, in <module>
bootstrap()
File "C:\Users\gauth\AppData\Local\Temp\_MEI40002\cv2\__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "importlib\__init__.py", line 126, in import_module
File "C:\Users\gauth\AppData\Local\Temp\_MEI40002\cv2\__init__.py", line 181, in <module>
bootstrap()
File "C:\Users\gauth\AppData\Local\Temp\_MEI40002\cv2\__init__.py", line 76, in bootstrap
raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.
What did I try:
I deactivated my Antivirus.
It didn't work
I think I tried it all:
I installed the previous version of OpenCV:
pip install opencv-python==4.5.3.56
It didn't work
I installed the latest version:
pip install --upgrade opencv-python
pip install --upgrade pyinstaller
It didn't work
I tried to force the reinstallation:
pip3 install opencv-python --upgrade --force-reinstall
It didn't work
I added the path of cv2:
pyinstaller --onefile -F --uac-admin --icon="icon_PhoneBot_256.ico" --clean --noconsole --collect-data pyshadow --paths="C:\Users\gauth\AppData\Local\Programs\Python\Python310\Lib\site-packages\cv2" Project.py
It didn't work
Here are the logs of PyInstaller if it can help:
130 INFO: PyInstaller: 5.2
130 INFO: Python: 3.10.5
268 INFO: Platform: Windows-10-10.0.19044-SP0
269 INFO: wrote C:\Users\gauth\Documents\project\project_debug3\project.spec
275 INFO: UPX is not available.
275 INFO: Removing temporary files and cleaning cache in C:\Users\gauth\AppData\Local\pyinstaller
353 INFO: Extending PYTHONPATH with paths
['C:\\Users\\gauth\\Documents\\project\\project_debug3',
'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\cv2']
1144 INFO: checking Analysis
1144 INFO: Building Analysis because Analysis-00.toc is non existent
1146 INFO: Initializing module dependency graph...
1152 INFO: Caching module graph hooks...
1162 WARNING: Several hooks defined for module 'numpy'. Please take care they do not conflict.
1171 INFO: Analyzing base_library.zip ...
6500 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
6502 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib'
7762 INFO: Caching module dependency graph...
7923 INFO: running Analysis Analysis-00.toc
7940 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Users\gauth\AppData\Local\Programs\Python\Python310\python.exe
8203 INFO: Analyzing C:\Users\gauth\Documents\project\project_debug3\project.py
9270 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
13260 INFO: Processing pre-find module path hook site from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
13262 INFO: site: retargeting to fake-dir 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\fake-modules'
22225 INFO: Processing pre-safe import module hook six.moves from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
32496 INFO: Processing module hooks...
32501 INFO: Loading module hook 'hook-certifi.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
32518 INFO: Loading module hook 'hook-Cryptodome.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
33041 INFO: Loading module hook 'hook-cryptography.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34553 INFO: Loading module hook 'hook-cv2.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34568 INFO: Loading module hook 'hook-google.api_core.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34571 INFO: Loading module hook 'hook-googleapiclient.model.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34647 WARNING: collect_data_files - skipping data collection for module 'googleapiclient.discovery' as it is not a package.
34648 INFO: Loading module hook 'hook-httplib2.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34657 INFO: Loading module hook 'hook-lxml.etree.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34658 INFO: Loading module hook 'hook-lxml.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
35621 INFO: Loading module hook 'hook-pycparser.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
35622 INFO: Loading module hook 'hook-selenium.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
35985 INFO: Loading module hook 'hook-unidecode.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
37029 INFO: Loading module hook 'hook-numpy.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\numpy\\_pyinstaller'...
37120 INFO: Import to be excluded not found: 'f2py'
37133 INFO: Loading module hook 'hook-difflib.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37138 INFO: Loading module hook 'hook-distutils.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37139 INFO: Loading module hook 'hook-distutils.util.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37144 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37742 INFO: Loading module hook 'hook-heapq.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37749 INFO: Loading module hook 'hook-lib2to3.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37806 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37812 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
37818 INFO: Loading module hook 'hook-pandas.io.formats.style.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
39392 WARNING: Hidden import "jinja2" not found!
39392 INFO: Loading module hook 'hook-pandas.plotting.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
39494 INFO: Loading module hook 'hook-pandas.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
41173 INFO: Loading module hook 'hook-pickle.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
41180 INFO: Loading module hook 'hook-PIL.Image.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
42001 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
42008 INFO: Loading module hook 'hook-PIL.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
42034 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
42044 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
43000 INFO: Processing pre-safe import module hook win32com from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
43424 WARNING: Hidden import "pkg_resources.py2_warn" not found!
43425 WARNING: Hidden import "pkg_resources.markers" not found!
43431 INFO: Loading module hook 'hook-platform.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
43436 INFO: Loading module hook 'hook-PyQt5.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
43663 WARNING: Hidden import "sip" not found!
43663 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
43837 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
44120 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
44428 INFO: Loading module hook 'hook-pytz.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
44731 INFO: Loading module hook 'hook-setuptools.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
46244 INFO: Loading module hook 'hook-sqlite3.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
46833 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
46839 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
47606 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
47607 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
47610 INFO: Loading module hook 'hook-xml.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
47611 INFO: Loading module hook 'hook-_tkinter.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
47785 INFO: checking Tree
47785 INFO: Building Tree because Tree-00.toc is non existent
47787 INFO: Building Tree Tree-00.toc
47929 INFO: checking Tree
47930 INFO: Building Tree because Tree-01.toc is non existent
47932 INFO: Building Tree Tree-01.toc
48034 INFO: checking Tree
48034 INFO: Building Tree because Tree-02.toc is non existent
48036 INFO: Building Tree Tree-02.toc
48043 INFO: Loading module hook 'hook-lxml.isoschematron.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
48053 INFO: Loading module hook 'hook-lxml.objectify.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
48054 INFO: Loading module hook 'hook-pythoncom.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
48631 INFO: Loading module hook 'hook-pywintypes.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
49207 INFO: Loading module hook 'hook-win32com.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
49737 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
49837 INFO: Looking for ctypes DLLs
50085 INFO: Analyzing run-time hooks ...
50106 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
50113 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
50120 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32api.py'
50121 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
50123 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
50126 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
50130 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pyqt5.py'
50133 INFO: Including run-time hook 'C:\\Users\\gauth\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
50162 INFO: Looking for dynamic libraries
C:\Users\gauth\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py:156: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
__import__(package)
54020 INFO: Looking for eggs
54021 INFO: Using Python library C:\Users\gauth\AppData\Local\Programs\Python\Python310\python310.dll
54023 INFO: Found binding redirects:
[]
54041 INFO: Warnings written to C:\Users\gauth\Documents\project\project_debug3\build\project\warn-project.txt
54297 INFO: Graph cross-reference written to C:\Users\gauth\Documents\project\project_debug3\build\project\xref-project.html
54366 INFO: Appending 'datas' from .spec
54373 INFO: checking PYZ
54373 INFO: Building PYZ because PYZ-00.toc is non existent
54375 INFO: Building PYZ (ZlibArchive) C:\Users\gauth\Documents\project\project_debug3\build\project\PYZ-00.pyz
56527 INFO: Building PYZ (ZlibArchive) C:\Users\gauth\Documents\project\project_debug3\build\project\PYZ-00.pyz completed successfully.
56577 INFO: checking PKG
56578 INFO: Building PKG because PKG-00.toc is non existent
56580 INFO: Building PKG (CArchive) project.pkg
86615 INFO: Building PKG (CArchive) project.pkg completed successfully.
86640 INFO: Bootloader C:\Users\gauth\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
86640 INFO: checking EXE
86640 INFO: Building EXE because EXE-00.toc is non existent
86641 INFO: Building EXE from EXE-00.toc
86643 INFO: Copying bootloader EXE to C:\Users\gauth\Documents\project\project_debug3\dist\project.exe.notanexecutable
86648 INFO: Copying icon to EXE
86653 INFO: Copying icons from ['C:\\Users\\gauth\\Documents\\project\\project_debug3\\icon_project_256.ico']
86654 INFO: Writing RT_GROUP_ICON 0 resource with 20 bytes
86654 INFO: Writing RT_ICON 1 resource with 14739 bytes
86657 INFO: Copying 0 resources to EXE
86657 INFO: Embedding manifest in EXE
86659 INFO: Updating manifest in C:\Users\gauth\Documents\project\project_debug3\dist\project.exe.notanexecutable
86660 INFO: Updating resource type 24 name 1 language 0
86663 INFO: Appending PKG archive to EXE
86763 INFO: Fixing EXE headers
87437 INFO: Building EXE from EXE-00.toc completed successfully.
Is there anyone who has any idea how to fix this issue?
The solution to the issues has been resolved, can check here if anyone faces same issues Github Pyinstaller
I had the same problem and it was solved by changing the OpenCV version
Exactly from version 4.6.0.66 to 4.5.5.64
While generating a .exe via auto-py-to-exe, I face the following output in auto-py-to-exe window.
Running auto-py-to-exe v2.18.0
Building directory: C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw
Provided command: pyinstaller --noconfirm --onefile --console "C:/Users/user_name/Desktop/files/Name2/Name3/Single_file.py"
Recursion Limit is set to 5000
Executing: pyinstaller --noconfirm --onefile --console C:/Users/user_name/Desktop/files/Name2/Name3/Single_file.py --distpath C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\application --workpath C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\build --specpath C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw
35143 INFO: PyInstaller: 4.10
35157 INFO: Python: 3.9.7 (conda)
35202 INFO: Platform: Windows-10-10.0.22000-SP0
35208 INFO: wrote C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\Single_file.spec
35242 INFO: UPX is not available.
35247 INFO: Extending PYTHONPATH with paths
['C:\\Users\\user_name\\Desktop\\files\\Name2\\Name3']
35629 INFO: checking Analysis
35656 INFO: Building Analysis because Analysis-00.toc is non existent
35666 INFO: Initializing module dependency graph...
35677 INFO: Caching module graph hooks...
35706 INFO: Analyzing base_library.zip ...
37658 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
37669 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib'
40227 INFO: Caching module dependency graph...
40402 INFO: running Analysis Analysis-00.toc
40450 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Users\user_name\Anaconda3\envs\Environment1\python.exe
40748 INFO: Analyzing C:\Users\user_name\Desktop\files\Name2\Name3\Single_file.py
44125 INFO: Processing pre-find module path hook site from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
44146 INFO: site: retargeting to fake-dir 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\fake-modules'
49605 INFO: Processing pre-safe import module hook six.moves from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
59349 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
61799 INFO: Processing pre-safe import module hook win32com from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
80027 INFO: Processing module hooks...
80037 INFO: Loading module hook 'hook-appdirs.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
80064 INFO: Loading module hook 'hook-bcrypt.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
80077 INFO: Loading module hook 'hook-certifi.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
80094 INFO: Loading module hook 'hook-cryptography.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
80443 INFO: Loading module hook 'hook-docutils.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
82177 INFO: Loading module hook 'hook-eel.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
82349 INFO: Loading module hook 'hook-IPython.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
82847 INFO: Loading module hook 'hook-jedi.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
83937 INFO: Loading module hook 'hook-jinja2.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
83976 INFO: Loading module hook 'hook-jsonschema.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84008 INFO: Loading module hook 'hook-nacl.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84028 INFO: Loading module hook 'hook-nbformat.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84127 INFO: Loading module hook 'hook-openpyxl.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84231 INFO: Loading module hook 'hook-parso.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84253 INFO: Loading module hook 'hook-pycparser.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84284 INFO: Loading module hook 'hook-pythoncom.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
84712 INFO: Loading module hook 'hook-pywintypes.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85221 INFO: Loading module hook 'hook-regex.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85253 INFO: Loading module hook 'hook-sklearn.cluster.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85263 INFO: Loading module hook 'hook-sklearn.linear_model.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85278 INFO: Loading module hook 'hook-sklearn.metrics.cluster.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85292 INFO: Loading module hook 'hook-sklearn.neighbors.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85307 WARNING: Hidden import "sklearn.neighbors._typedefs" not found!
85386 INFO: Loading module hook 'hook-sklearn.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85852 INFO: Loading module hook 'hook-sklearn.tree.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85862 INFO: Loading module hook 'hook-sklearn.utils.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
85870 INFO: Loading module hook 'hook-win32com.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
86357 INFO: Loading module hook 'hook-zmq.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
86741 INFO: Loading module hook 'hook-babel.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
87076 INFO: Loading module hook 'hook-difflib.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
87118 INFO: Loading module hook 'hook-distutils.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
87183 INFO: Loading module hook 'hook-distutils.util.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
87206 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
87326 INFO: Loading module hook 'hook-gevent.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
87801 INFO: Determining a mapping of distributions to packages...
114340 WARNING: Unable to find package for requirement zope.interface from package gevent.
114346 WARNING: Unable to find package for requirement zope.event from package gevent.
114377 INFO: Packages required by gevent:
['setuptools', 'cffi', 'greenlet']
115285 INFO: Loading module hook 'hook-heapq.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
115289 INFO: Loading module hook 'hook-importlib_metadata.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
115297 INFO: Loading module hook 'hook-lib2to3.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
115360 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
116176 INFO: Matplotlib backend "GTK3Agg": ignored
backend Gtk3Agg requires cairo
116604 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
117041 INFO: Matplotlib backend "GTK4Agg": ignored
backend Gtk4Agg requires cairo
117485 INFO: Matplotlib backend "GTK4Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
117889 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\matplotlib\backends\__init__.py)
118809 INFO: Matplotlib backend "nbAgg": added
119443 INFO: Matplotlib backend "QtAgg": added
119900 INFO: Matplotlib backend "QtCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
120499 INFO: Matplotlib backend "Qt5Agg": added
120936 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
121752 INFO: Matplotlib backend "TkAgg": added
122511 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
123133 INFO: Matplotlib backend "WebAgg": added
123877 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
124301 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
124763 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
125250 INFO: Matplotlib backend "agg": added
125665 INFO: Matplotlib backend "cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
126560 INFO: Matplotlib backend "pdf": added
127371 INFO: Matplotlib backend "pgf": added
127971 INFO: Matplotlib backend "ps": added
128461 INFO: Matplotlib backend "svg": added
129147 INFO: Matplotlib backend "template": added
131552 INFO: Loading module hook 'hook-matplotlib.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
131992 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
132008 INFO: Loading module hook 'hook-numpy.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
132074 WARNING: Conda distribution 'numpy', dependency of 'numpy', was not found. If you installed this distribution with pip then you may ignore this warning.
132127 INFO: Import to be excluded not found: 'f2py'
132141 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
132153 INFO: Loading module hook 'hook-packaging.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
132164 INFO: Loading module hook 'hook-pandas.io.formats.style.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
132651 INFO: Loading module hook 'hook-pandas.plotting.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
132936 INFO: Loading module hook 'hook-pandas.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
133583 INFO: Loading module hook 'hook-pickle.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
133608 INFO: Loading module hook 'hook-PIL.Image.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
133895 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
133911 INFO: Loading module hook 'hook-PIL.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
133928 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
133969 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
134697 WARNING: Hidden import "pkg_resources.py2_warn" not found!
134756 WARNING: Hidden import "pkg_resources.markers" not found!
134770 INFO: Loading module hook 'hook-pygments.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
136336 INFO: Loading module hook 'hook-PyQt5.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137166 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137233 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137343 INFO: Loading module hook 'hook-PyQt5.QtSvg.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137569 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137769 INFO: Loading module hook 'hook-pytz.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137950 INFO: Loading module hook 'hook-scipy.linalg.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
137961 INFO: Loading module hook 'hook-scipy.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
138006 INFO: Loading module hook 'hook-scipy.sparse.csgraph.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
138026 INFO: Loading module hook 'hook-scipy.spatial.transform.rotation.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
138152 INFO: Loading module hook 'hook-scipy.special._ellip_harm_2.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
138166 INFO: Loading module hook 'hook-scipy.special._ufuncs.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
138177 INFO: Loading module hook 'hook-scipy.stats._stats.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
138189 INFO: Loading module hook 'hook-setuptools.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
139085 INFO: Loading module hook 'hook-sphinx.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
143598 INFO: Loading module hook 'hook-sqlite3.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
143726 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
143729 INFO: Loading module hook 'hook-wcwidth.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
143737 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
144095 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
144121 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
144125 INFO: Loading module hook 'hook-xml.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
144133 INFO: Loading module hook 'hook-zope.interface.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
144142 INFO: Loading module hook 'hook-_tkinter.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
144352 INFO: checking Tree
144366 INFO: Building Tree because Tree-00.toc is non existent
144377 INFO: Building Tree Tree-00.toc
144665 INFO: checking Tree
144682 INFO: Building Tree because Tree-01.toc is non existent
144691 INFO: Building Tree Tree-01.toc
144820 INFO: checking Tree
144833 INFO: Building Tree because Tree-02.toc is non existent
144844 INFO: Building Tree Tree-02.toc
144855 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks'...
145022 INFO: Looking for ctypes DLLs
145173 INFO: Analyzing run-time hooks ...
145230 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
145276 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
145297 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
145335 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
145372 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32api.py'
145383 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
145428 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
145442 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
145452 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pyqt5.py'
145466 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_mplconfig.py'
145481 INFO: Including run-time hook 'C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_traitlets.py'
145518 INFO: Looking for dynamic libraries
146610 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\_device.cp39-win_amd64.pyd
146622 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\_version.cp39-win_amd64.pyd
146636 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\_poll.cp39-win_amd64.pyd
146655 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\utils.cp39-win_amd64.pyd
146666 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\error.cp39-win_amd64.pyd
146669 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\message.cp39-win_amd64.pyd
146703 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\socket.cp39-win_amd64.pyd
146719 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\_proxy_steerable.cp39-win_amd64.pyd
146733 WARNING: lib not found: libzmq.cp39-win_amd64.pyd dependency of C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\zmq\backend\cython\context.cp39-win_amd64.pyd
147795 INFO: Looking for eggs
147805 INFO: Using Python library C:\Users\user_name\Anaconda3\envs\Environment1\python39.dll
147817 INFO: Found binding redirects:
[]
147847 INFO: Warnings written to C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\build\Single_file\warn-Single_file.txt
148152 INFO: Graph cross-reference written to C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\build\Single_file\xref-Single_file.html
148369 INFO: checking PYZ
148382 INFO: Building PYZ because PYZ-00.toc is non existent
148391 INFO: Building PYZ (ZlibArchive) C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\build\Single_file\PYZ-00.pyz
151269 INFO: Building PYZ (ZlibArchive) C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\build\Single_file\PYZ-00.pyz completed successfully.
151335 INFO: checking PKG
151351 INFO: Building PKG because PKG-00.toc is non existent
151366 INFO: Building PKG (CArchive) Single_file.pkg
192578 INFO: Building PKG (CArchive) Single_file.pkg completed successfully.
192707 INFO: Bootloader C:\Users\user_name\Anaconda3\envs\Environment1\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
192738 INFO: checking EXE
192747 INFO: Building EXE because EXE-00.toc is non existent
192776 INFO: Building EXE from EXE-00.toc
192785 INFO: Copying bootloader EXE to C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\application\Single_file.exe.notanexecutable
194475 INFO: Copying icon to EXE
194491 INFO: Copying icons from ['C:\\Users\\user_name\\Anaconda3\\envs\\Environment1\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
195030 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
195046 INFO: Writing RT_ICON 1 resource with 3752 bytes
195076 INFO: Writing RT_ICON 2 resource with 2216 bytes
195077 INFO: Writing RT_ICON 3 resource with 1384 bytes
195085 INFO: Writing RT_ICON 4 resource with 37019 bytes
195085 INFO: Writing RT_ICON 5 resource with 9640 bytes
195094 INFO: Writing RT_ICON 6 resource with 4264 bytes
195110 INFO: Writing RT_ICON 7 resource with 1128 bytes
195124 INFO: Copying 0 resources to EXE
195135 INFO: Emedding manifest in EXE
195146 INFO: Updating manifest in C:\Users\user_name\AppData\Local\Temp\tmpcujb3jiw\application\Single_file.exe.notanexecutable
195602 INFO: Updating resource type 24 name 1 language 0
195615 INFO: Appending PKG archive to EXE
218702 INFO: Building EXE from EXE-00.toc completed successfully.
Moving project to: C:\Users\user_name\output
Complete.
Once the .exe is generated I try to run it but it closes by it self immediately.
while running the .exe from the CMD I face the following outcome:
xgboost\compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
Traceback (most recent call last):
File "Single_file.py", line 12, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "xgboost\__init__.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "xgboost\core.py", line 203, in <module>
File "xgboost\core.py", line 157, in _load_lib
File "xgboost\libpath.py", line 64, in find_lib_path
xgboost.libpath.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path. List of candidates:
- C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file\xgboost\lib\xgboost.dll
- C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file\xgboost\..\..\lib\xgboost.dll
- C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file\lib\xgboost.dll
- C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file\xgboost\../../windows/x64/Release/xgboost.dll
- C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file\xgboost\./windows/x64/Release/xgboost.dll
XGBoost Python package path: C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file\xgboost
sys.prefix: C:\Users\user_name\Desktop\files\Name2\Name3\output\Single_file
See: https://xgboost.readthedocs.io/en/latest/build.html for installing XGBoost.
[17764] Failed to execute script 'Single_file' due to unhandled exception!
I tried other tools than auto-py-to-exe, for example: py2exe or pyinstaller but faced the same issue as well!
The .py relies on the following libraries:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
import matplotlib.pyplot as plt
import xgboost as xgb
import re
from sklearn.model_selection import train_test_split
from sklearn.multioutput import MultiOutputRegressor
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score
from operator import add
import statistics
import warnings
Support/ideas would be highly appreciated.
Have you installed the XGBoost library?
It cannot find the XGBoost library:
xgboost.libpath.XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path. List of candidates:
...........
See: https://xgboost.readthedocs.io/en/latest/build.html for installing XGBoost.
I'm trying to put a simple flask server into executable by using pyinstaller -F server.py command
When running the exe file, I obtain the following error:
Traceback (most recent call last):
File "server.py", line 4, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\users\pc\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "transform.py", line 17, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\users\pc\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "convert.py", line 12, in <module>
File "pymorphy2\analyzer.py", line 200, in __init__
File "pymorphy2\analyzer.py", line 280, in choose_dictionary_path
File "pymorphy2\analyzer.py", line 144, in lang_dict_path
ValueError: Can't find a dictionary for language 'ru'. Installed languages: []. Try installing pymorphy2-dicts-ru package.
[18156] Failed to execute script server
Already tried to pip install pymorphy2-dicts-ru, it didn't help
Below are the logs of pyinstaller -F server.py
96 INFO: PyInstaller: 4.1
97 INFO: Python: 3.6.8
97 INFO: Platform: Windows-10-10.0.19041-SP0
103 INFO: wrote C:\Users\pc\Desktop\hack\code\nlp-server\server.spec
118 INFO: UPX is not available.
122 INFO: Extending PYTHONPATH with paths
['C:\\Users\\pc\\Desktop\\hack\\code\\nlp-server',
'C:\\Users\\pc\\Desktop\\hack\\code\\nlp-server']
139 INFO: checking Analysis
140 INFO: Building Analysis because Analysis-00.toc is non existent
140 INFO: Initializing module dependency graph...
145 INFO: Caching module graph hooks...
169 INFO: Analyzing base_library.zip ...
3178 INFO: Caching module dependency graph...
3265 INFO: running Analysis Analysis-00.toc
3268 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\pc\appdata\local\programs\python\python36\python.exe
3440 INFO: Analyzing C:\Users\pc\Desktop\hack\code\nlp-server\server.py
4658 INFO: Processing pre-find module path hook distutils from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
4659 INFO: distutils: retargeting to non-venv dir 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib'
7000 INFO: Processing pre-safe import module hook setuptools.extern.six.moves from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-setuptools.extern.six.m
oves.py'.
7477 INFO: Processing pre-find module path hook site from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
7478 INFO: site: retargeting to fake-dir 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\fake-modules'
10016 INFO: Processing module hooks...
10017 INFO: Loading module hook 'hook-jinja2.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
10031 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10034 INFO: Excluding import of doctest from module difflib
10034 INFO: Loading module hook 'hook-distutils.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10035 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10038 INFO: Excluding import of lib2to3.refactor from module distutils.util
10038 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10146 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10148 INFO: Excluding import of doctest from module heapq
10149 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10247 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10249 INFO: Import to be excluded not found: 'test'
10249 INFO: Loading module hook 'hook-numpy.core.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10827 INFO: Loading module hook 'hook-numpy.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10830 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10832 INFO: Excluding import of pytest from module numpy._pytesttester
10833 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
10835 INFO: Excluding import of argparse from module pickle
10835 INFO: Loading module hook 'hook-pkg_resources.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
11162 INFO: Processing pre-safe import module hook win32com from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
11219 INFO: Processing pre-safe import module hook win32com from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
11462 WARNING: Hidden import "pkg_resources.py2_warn" not found!
11464 WARNING: Hidden import "pkg_resources.markers" not found!
11465 INFO: Excluding import of __main__ from module pkg_resources
11466 INFO: Loading module hook 'hook-setuptools.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12062 INFO: Excluding import of setuptools.py27compat from module setuptools.command.easy_install
12062 INFO: Excluding import of setuptools.py27compat from module setuptools.package_index
12065 INFO: Excluding import of setuptools.py33compat from module setuptools.depends
12065 INFO: Excluding import of setuptools.py33compat from module setuptools.package_index
12066 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12067 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12068 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12121 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks'...
12123 INFO: Excluding import of numpy from module setuptools.msvc
12199 INFO: Looking for ctypes DLLs
12231 INFO: Analyzing run-time hooks ...
12237 INFO: Including run-time hook 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
12238 INFO: Including run-time hook 'c:\\users\\pc\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
12250 INFO: Looking for dynamic libraries
13139 INFO: Looking for eggs
13139 INFO: Using Python library c:\users\pc\appdata\local\programs\python\python36\python36.dll
13139 INFO: Found binding redirects:
[]
13150 INFO: Warnings written to C:\Users\pc\Desktop\hack\code\nlp-server\build\server\warn-server.txt
13296 INFO: Graph cross-reference written to C:\Users\pc\Desktop\hack\code\nlp-server\build\server\xref-server.html
13324 INFO: checking PYZ
13325 INFO: Building PYZ because PYZ-00.toc is non existent
13326 INFO: Building PYZ (ZlibArchive) C:\Users\pc\Desktop\hack\code\nlp-server\build\server\PYZ-00.pyz
14479 INFO: Building PYZ (ZlibArchive) C:\Users\pc\Desktop\hack\code\nlp-server\build\server\PYZ-00.pyz completed successfully.
14505 INFO: checking PKG
14505 INFO: Building PKG because PKG-00.toc is non existent
14505 INFO: Building PKG (CArchive) PKG-00.pkg
20039 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
20043 INFO: Bootloader c:\users\pc\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
20043 INFO: checking EXE
20043 INFO: Building EXE because EXE-00.toc is non existent
20043 INFO: Building EXE from EXE-00.toc
20044 INFO: Appending archive to EXE C:\Users\pc\Desktop\hack\code\nlp-server\dist\server.exe
20060 INFO: Building EXE from EXE-00.toc completed successfully.
code of the server.py
from flask import Flask, request, jsonify
from transform import transform_text
server = Flask(__name__);
#server.route('/send', methods=['POST'])
def send():
print("POST /send request")
# obtaining passed args
fname = request.json['fname']
text = request.json['text']
# updating the text
text = f"{transform_text(text, 'Masc', fname)}"
# sending back updated text
return jsonify({'text': text})
if __name__ == '__main__':
server.run(host='0.0.0.0', port='8080', debug=True)
tranform_text() function uses pymorphy to change sentences from 1st person form ("I play") to 3rd person form("He/She plays")
So, is there any way to make the executable work?
This is the problem of the package ;pymorphy2_dicts_ru;. Files from the data directory are not copied to the bundle.
To solve the problem, you need to perform two steps:
Add the data directory to the pyinstaller spec file:
...
# pymorph data
import pymorphy2_dicts_ru
pymorph_data = pymorphy2_dicts_ru.get_path()
a = Analysis(['main.py'],
pathex=['.'],
binaries=[],
datas=[(pymorph_data, 'pymorphy2_dicts_ru/data')],
hiddenimports=[],
hookspath=[],
...
Set the path to the data directory in the code before import the pymorphy2 module (to main.py for example):
...
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
os.environ["PYMORPHY2_DICT_PATH"] = str(pathlib.Path(sys._MEIPASS).joinpath('pymorphy2_dicts_ru/data'))
...
Currently i meet issue while packaging exe through pyinstaller .
I create a virtual environmental under pycharm , and my programe is very simple
a = input("please input a :")
b = input("please input b: ")
c = print(a+b)
the code stored in test.py . and then I type pyinstaller -F test.py on pycharm consle , it shows as below . as you seen , many libs not found , and packaing failed .
(venv) C:\cheng\Project\STC_Tool\venv>pyinstaller -v
3.6
(venv) C:\cheng\Project\STC_Tool\venv>pyinstaller -F test.py
67 INFO: PyInstaller: 3.6
67 INFO: Python: 3.7.8
70 INFO: Platform: Windows-10-10.0.18362-SP0
72 INFO: wrote C:\cheng\Project\STC_Tool\venv\test.spec
73 INFO: UPX is not available.
74 INFO: Extending PYTHONPATH with paths
['C:\\cheng\\Project\\STC_Tool\\venv', 'C:\\cheng\\Project\\STC_Tool\\venv']
75 INFO: checking Analysis
77 INFO: Building because C:\cheng\Project\STC_Tool\venv\test.py changed
78 INFO: Initializing module dependency graph...
80 INFO: Caching module graph hooks...
83 INFO: Analyzing base_library.zip ...
2178 INFO: Processing pre-find module path hook distutils
2191 INFO: distutils: retargeting to non-venv dir 'C:\\cheng\\Software\\Python\\lib'
3247 INFO: Caching module dependency graph...
3348 INFO: running Analysis Analysis-00.toc
3351 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\cheng\project\stc_tool\venv\scripts\python.exe
3365 WARNING: lib not found: VERSION.dll dependency of c:\cheng\project\stc_tool\venv\scripts\python.exe
3371 INFO: Analyzing C:\cheng\Project\STC_Tool\venv\test.py
3373 INFO: Processing module hooks...
3374 INFO: Loading module hook "hook-distutils.py"...
3375 INFO: Loading module hook "hook-encodings.py"...
3656 INFO: Loading module hook "hook-pydoc.py"...
3657 INFO: Loading module hook "hook-sysconfig.py"...
3659 INFO: Loading module hook "hook-xml.py"...
3910 INFO: Looking for ctypes DLLs
3915 INFO: Analyzing run-time hooks ...
3917 INFO: Looking for dynamic libraries
3937 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\select.pyd
3947 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\select.pyd
3966 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_socket.pyd
3974 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_socket.pyd
3978 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_lzma.pyd
3994 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_lzma.pyd
4001 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_bz2.pyd
4027 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_bz2.pyd
4052 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_hashlib.pyd
4062 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_hashlib.pyd
4071 WARNING: lib not found: libcrypto-1_1.dll dependency of C:\cheng\Software\Python\DLLs\_hashlib.pyd
4079 WARNING: lib not found: libssl-1_1.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
4095 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
4097 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
4106 WARNING: lib not found: libcrypto-1_1.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
4128 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\unicodedata.pyd
4141 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\unicodedata.pyd
4161 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\pyexpat.pyd
4171 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\pyexpat.pyd
4174 INFO: Looking for eggs
4174 INFO: Python library not in binary dependencies. Doing additional searching...
4180 INFO: Using Python library
4180 INFO: Found binding redirects:
[]
4194 INFO: Warnings written to C:\cheng\Project\STC_Tool\venv\build\test\warn-test.txt
4252 INFO: Graph cross-reference written to C:\cheng\Project\STC_Tool\venv\build\test\xref-test.html
4261 INFO: checking PYZ
4268 INFO: Building because toc changed
4270 INFO: Building PYZ (ZlibArchive) C:\cheng\Project\STC_Tool\venv\build\test\PYZ-00.pyz
4875 INFO: Building PYZ (ZlibArchive) C:\cheng\Project\STC_Tool\venv\build\test\PYZ-00.pyz completed successfully.
4890 INFO: checking PKG
4891 INFO: Building because toc changed
4893 INFO: Building PKG (CArchive) PKG-00.pkg
Traceback (most recent call last):
File "C:\cheng\Software\Python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\cheng\Software\Python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\cheng\Project\STC_Tool\venv\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
exec(code, spec_namespace)
File "C:\cheng\Project\STC_Tool\venv\test.spec", line 33, in <module>
console=True )
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\api.py", line 436, in __init__
upx_exclude=self.upx_exclude
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\api.py", line 199, in __init__
self.__postinit__()
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
self.assemble()
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\api.py", line 262, in assemble
dist_nm=inm)
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\utils.py", line 220, in checkCache
digest = cacheDigest(fnm, redirects)
File "c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\utils.py", line 365, in cacheDigest
with open(fnm, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: ''
if I remobve -F option and type pyinstaller test.py directly , the packaing would be successfully
(venv) C:\cheng\Project\STC_Tool\venv>pyinstaller test.py
65 INFO: PyInstaller: 3.6
65 INFO: Python: 3.7.8
66 INFO: Platform: Windows-10-10.0.18362-SP0
68 INFO: wrote C:\cheng\Project\STC_Tool\venv\test.spec
70 INFO: UPX is not available.
70 INFO: Extending PYTHONPATH with paths
['C:\\cheng\\Project\\STC_Tool\\venv', 'C:\\cheng\\Project\\STC_Tool\\venv']
70 INFO: checking Analysis
75 INFO: checking PYZ
98 INFO: checking PKG
98 INFO: Building because toc changed
99 INFO: Building PKG (CArchive) PKG-00.pkg
125 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
128 INFO: Bootloader c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
129 INFO: checking EXE
131 INFO: Building because toc changed
132 INFO: Building EXE from EXE-00.toc
134 INFO: Appending archive to EXE C:\cheng\Project\STC_Tool\venv\build\test\test.exe
137 INFO: Building EXE from EXE-00.toc completed successfully.
142 INFO: checking COLLECT
WARNING: The output directory "C:\cheng\Project\STC_Tool\venv\dist\test" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
On your own risk, you can use the option `--noconfirm` to get rid of this question.
2769 INFO: Removing dir C:\cheng\Project\STC_Tool\venv\dist\test
2780 INFO: Building COLLECT COLLECT-00.toc
2830 INFO: Building COLLECT COLLECT-00.toc completed successfully.
but the test.exe flashed and closed after I click , I using screen recording tool capture the flash error
, it shows Error loading Python DLL 'c:\cheng\Project\STC_Tool\venv\dist\test'
the python installed on win10 is python3.7 , and I am using win10 64 bit operating system.
could you please give me some suggestiones .
after unistall pyinstaller and then reinstall pyinstaller again , issue solved.
please considered to update system variable as well.
I am trying to ship an executable from my python script which lives inside a virtual environment using pipenv which again relies on pyenv for python versioning. For that, I want to us pyinstaller.
What I did:
pipenv install pyinstaller
pyinstaller --onefile my_script.py
Output:
40 INFO: PyInstaller: 3.5
40 INFO: Python: 3.6.9
41 INFO: Platform: Linux-4.15.0-65-generic-x86_64-with-debian-stretch-sid
42 INFO: wrote /home/matthaeus/cybathlon/planvec/qt_video_gui_example.spec
44 INFO: UPX is not available.
45 INFO: Extending PYTHONPATH with paths
['/home/matthaeus/cybathlon/planvec', '/home/matthaeus/cybathlon/planvec']
45 INFO: checking Analysis
45 INFO: Building Analysis because Analysis-00.toc is non existent
45 INFO: Initializing module dependency graph...
46 INFO: Initializing module graph hooks...
47 INFO: Analyzing base_library.zip ...
2786 INFO: running Analysis Analysis-00.toc
2801 INFO: Caching module hooks...
2805 INFO: Analyzing /home/matthaeus/cybathlon/planvec/qt_video_gui_example.py
3284 INFO: Processing pre-find module path hook distutils
3285 INFO: distutils: retargeting to non-venv dir '/home/matthaeus/.pyenv/versions/3.6.9/lib/python3.6/distutils/__init__.py'
3972 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
4336 INFO: Processing pre-find module path hook site
4337 INFO: site: retargeting to fake-dir '/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/fake-modules'
6327 INFO: Loading module hooks...
6328 INFO: Loading module hook "hook-numpy.core.py"...
6458 INFO: Loading module hook "hook-sysconfig.py"...
6464 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
6534 INFO: Loading module hook "hook-scipy.py"...
6535 INFO: Loading module hook "hook-PyQt5.py"...
6549 WARNING: Hidden import "sip" not found!
6549 INFO: Loading module hook "hook-pkg_resources.py"...
6788 INFO: Processing pre-safe import module hook win32com
7015 INFO: Loading module hook "hook-numpy.py"...
7015 INFO: Loading module hook "hook-cv2.py"...
7016 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
7048 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
7096 INFO: Loading module hook "hook-pydoc.py"...
7097 INFO: Loading module hook "hook-xml.py"...
7150 INFO: Loading module hook "hook-encodings.py"...
7203 INFO: Loading module hook "hook-setuptools.py"...
7423 WARNING: Hidden import "distutils.command.build_ext" not found!
7680 INFO: Looking for ctypes DLLs
7762 INFO: Analyzing run-time hooks ...
7769 INFO: Including run-time hook 'pyi_rth_pyqt5.py'
7770 INFO: Including run-time hook 'pyi_rth_pkgres.py'
7771 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
7785 INFO: Looking for dynamic libraries
9784 INFO: Looking for eggs
9784 INFO: Python library not in binary dependencies. Doing additional searching...
Traceback (most recent call last):
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/bin/pyinstaller", line 8, in <module>
sys.exit(run())
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 791, in build
exec(code, spec_namespace)
File "/home/matthaeus/cybathlon/planvec/qt_video_gui_example.spec", line 17, in <module>
noarchive=False)
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 243, in __init__
self.__postinit__()
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
self.assemble()
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 575, in assemble
self._check_python_library(self.binaries)
File "/home/matthaeus/.local/share/virtualenvs/planvec-R86NQhbu/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 681, in _check_python_library
raise IOError(msg)
OSError: Python library not found: libpython3.6mu.so.1.0, libpython3.6m.so, libpython3.6m.so.1.0, libpython3.6.so.1.0
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.
* On Debian/Ubuntu, you would need to install Python development packages
* apt-get install python3-dev
* apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
I tried the recommended python3-dev and python-dev installations without luck.
Now, I hope someone can enlighten me what is going on here!
Cheers,
Matt
You need to build with CPython shared-library enabled.
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.9
eval "$(pyenv init -)"
Reference: https://github.com/pyenv/pyenv/wiki