Reducing .exe file using virtual environment - python

I am quite new to Python (and programming in general to be frank), and am using pyinstaller to create a .exe file from a .py file. After a few trials I figured that pyinstaller is including many unnecessary libraries such as scipy which is making my file extremely big.
To get around that I made a virtual environment and installed the modules I needed. However, when I tried making the .exe while still in the venv using pyinstaller -w -F -i "iconpath" filename.py its not working (it just stops after the last line in the code below):
126 INFO: PyInstaller: 3.6
126 INFO: Python: 3.8.1
127 INFO: Platform: Windows-10-10.0.16299-SP0
128 INFO: wrote C:\Users\26039190\RefCal_v4\RefCal_v4.spec
131 INFO: UPX is not available.
139 INFO: Extending PYTHONPATH with paths
['C:\\Users\\26039190\\RefCal_v4', 'C:\\Users\\26039190\\RefCal_v4']
139 INFO: checking Analysis
139 INFO: Building Analysis because Analysis-00.toc is non existent
139 INFO: Initializing module dependency graph...
143 INFO: Caching module graph hooks...
153 INFO: Analyzing base_library.zip ...
5696 INFO: Processing pre-find module path hook distutils
5697 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\26039190\\AppData\\Local\\Programs\\Python\\Python38-32\\lib'
9412 INFO: Caching module dependency graph...
9565 INFO: running Analysis Analysis-00.toc
9570 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\26039190\env\scripts\python.exe
9601 INFO: Analyzing C:\Users\26039190\RefCal_v4\RefCal_v4.py
13180 INFO: Processing pre-find module path hook site
13181 INFO: site: retargeting to fake-dir 'c:\\users\\26039190\\env\\lib\\site-packages\\PyInstaller\\fake-modules'
14909 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
21403 INFO: Processing pre-safe import module hook six.moves
122612 INFO: Processing module hooks...
122615 INFO: Loading module hook "hook-distutils.py"...
122622 INFO: Loading module hook "hook-encodings.py"...
122840 INFO: Loading module hook "hook-lib2to3.py"...
122846 INFO: Loading module hook "hook-matplotlib.backends.py"...
124362 INFO: Matplotlib backend "GTK3Agg": ignored
backend Gtk3Agg requires cairo
124925 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
125538 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (c:\users\26039190\env\lib\site-packages\matplotlib\backends\__init__.py)
126226 INFO: Matplotlib backend "nbAgg": ignored
No module named 'IPython'
127194 INFO: Matplotlib backend "Qt4Agg": added
128011 INFO: Matplotlib backend "Qt4Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
128802 INFO: Matplotlib backend "Qt5Agg": added
129303 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
130180 INFO: Matplotlib backend "TkAgg": added
131163 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
131845 INFO: Matplotlib backend "WebAgg": ignored
Traceback (most recent call last):
File "c:\users\26039190\env\lib\site-packages\matplotlib\backends\backend_webagg.py", line 27, in <module>
import tornado
ModuleNotFoundError: No module named 'tornado'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "c:\users\26039190\env\lib\site-packages\matplotlib\backends\backend_webagg.py", line 29, in <module>
raise RuntimeError("The WebAgg backend requires Tornado.")
RuntimeError: The WebAgg backend requires Tornado.
132610 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
133240 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
133885 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
134389 INFO: Matplotlib backend "agg": added
135129 INFO: Matplotlib backend "cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffiis installed
136202 INFO: Matplotlib backend "pdf": added
136913 INFO: Matplotlib backend "pgf": added
137455 INFO: Matplotlib backend "ps": added
138036 INFO: Matplotlib backend "svg": added
138739 INFO: Matplotlib backend "template": added
139367 INFO: Loading module hook "hook-matplotlib.py"...
139836 INFO: Loading module hook "hook-numpy.core.py"...
140027 INFO: Loading module hook "hook-numpy.py"...
140031 INFO: Loading module hook "hook-pkg_resources.py"...
140710 INFO: Processing pre-safe import module hook win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
140839 INFO: Processing pre-safe import module hook win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
140954 INFO: Excluding import '__main__'
140957 INFO: Removing import of __main__ from module pkg_resources
140966 INFO: Loading module hook "hook-pydoc.py"...
140976 INFO: Loading module hook "hook-PyQt5.py"...
Can anyone please shed some light?
By the way I am using anaconda, could that be the problem? Some people say I should uninstall anaconda, but I do not want to delete anaconda since I use Jupyter and Spyder quite a lot
Thank you everyone

collections is included in The Python Standard Library, no need to install it.

Related

Error "ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation." with Pyinstaller

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

error while running an .exe generated by auto-py-to-exe

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.

How to use pyinstaller with pipenv / pyenv

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

matplotlib qt5agg backend segmentation fault occurs after building distributable with pyinstaller

I'm building a GUI distributable using pyqt5, which shows a matplotlib plot in a popup window as the result. It works fine as a python code, but after building it into a binary via pyinstaller, it throws a segmentation fault when the button for creating the popup window that incorporates matplotlib is clicked.
It is run on Linux with Python 3.7 and Pyinstaller 3.5. All of the other functions are working fine except for the plotting part, and after a few trials I managed to find out that the popup window generation works fine, and that the segmentation fault is evoked when the FigureCanvasQt5Agg function is called. I tried to use gdb/faulthandler to trace the fault but wasn't able to since the fault occurs only for the distributable (correct me if I'm wrong).
Below is the stripped code:
from PyQt5 import QtCore, QtGui, QtWidgets
import matplotlib
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
class Ui_PMI_init(object):
def setupUi(self, PMI_init):
PMI_init.setObjectName("PMI_init")
PMI_init.resize(1113, 500)
self.centralwidget = QtWidgets.QWidget(PMI_init)
self.centralwidget.setObjectName("centralwidget")
self.btn_resultwin = QtWidgets.QPushButton(self.centralwidget)
self.btn_resultwin.setObjectName("btn_resultwin")
self.btn_resultwin.clicked.connect(self.resultWindow)
PMI_init.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(PMI_init)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1113, 21))
self.menubar.setObjectName("menubar")
PMI_init.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(PMI_init)
self.statusbar.setObjectName("statusbar")
PMI_init.setStatusBar(self.statusbar)
# Edit layout of the widgets
self.vbox_whole = QtWidgets.QVBoxLayout()
self.vbox_whole.addWidget(self.btn_resultwin)
self.centralwidget.setLayout(self.vbox_whole)
self.retranslateUi(PMI_init)
QtCore.QMetaObject.connectSlotsByName(PMI_init)
def retranslateUi(self, PMI_init):
_translate = QtCore.QCoreApplication.translate
PMI_init.setWindowTitle(_translate("PMI_init", "PMI Input Information"))
self.btn_resultwin.setText(_translate("PMI_init", "Show Results"))
def resultWindow(self,PMI_init):
self.winTable = showResultWindow()
self.winTable.show()
class showResultWindow(QtWidgets.QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.title = "Result Summary"
self.top = 150
self.left = 300
self.width = 870
self.height = 500
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
self.newUI()
def newUI(self):
self.fig = matplotlib.figure.Figure()
self.canvas = FigureCanvas(self.fig)
self.plot_layout = QtWidgets.QHBoxLayout()
self.plot_layout.addWidget(self.canvas)
self.result_grid = QtWidgets.QGridLayout()
self.table_rlabel1 = QtWidgets.QLabel()
self.table_rlabel2 = QtWidgets.QLabel()
self.table_rlabel3 = QtWidgets.QLabel()
self.table_rlabel4 = QtWidgets.QLabel()
self.table_rlabel5 = QtWidgets.QLabel()
self.table_rlabel1.setText('new')
self.table_rlabel2.setText('sum')
self.table_rlabel3.setText('new all')
self.table_rlabel4.setText('all')
self.table_rlabel5.setText('(%)')
self.result_grid.addWidget(self.table_rlabel1,0,1)
self.result_grid.addWidget(self.table_rlabel2,0,2)
self.result_grid.addWidget(self.table_rlabel3,0,3)
self.result_grid.addWidget(self.table_rlabel4,0,4)
self.result_grid.addWidget(self.table_rlabel5,0,5)
self.vbox = QtWidgets.QVBoxLayout()
self.vbox.addLayout(self.plot_layout)
self.vbox.addLayout(self.result_grid)
self.vbox.setStretchFactor(self.plot_layout,1)
self.vbox.setStretchFactor(self.result_grid,0)
self.setLayout(self.vbox)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
PMI_init = QtWidgets.QMainWindow()
ui = Ui_PMI_init()
ui.setupUi(PMI_init)
PMI_init.show()
sys.exit(app.exec_())
Also sharing the pyinstaller log, because some warnings and "excludes" occurr, which might be affecting the current status.
206 INFO: PyInstaller: 3.5
206 INFO: Python: 3.7.3
208 INFO: Platform: Linux-2.6.32-696.el6.x86_64-x86_64-with-redhat-6.6-Santiago
212 INFO: wrote /user/neonbadak/002.GUIDevelopment/code/segfault_strippedcode.spec
219 INFO: UPX is not available.
226 INFO: Extending PYTHONPATH with paths
['/user/neonbadak/002.GUIDevelopment/code',
'/user/neonbadak/002.GUIDevelopment/code']
226 INFO: checking Analysis
321 INFO: Building because /user/neonbadak/002.GUIDevelopment/code/segfault_strippedcode.py changed
322 INFO: Initializing module dependency graph...
342 INFO: Initializing module graph hooks...
349 INFO: Analyzing base_library.zip ...
7839 INFO: running Analysis Analysis-00.toc
7858 INFO: Caching module hooks...
7865 INFO: Analyzing /user/neonbadak/002.GUIDevelopment/code/segfault_strippedcode.py
8433 INFO: Processing pre-find module path hook distutils
12072 INFO: Processing pre-safe import module hook six.moves
17828 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
19177 INFO: Processing pre-find module path hook site
19181 INFO: site: retargeting to fake-dir '/user/neonbadak/anaconda3/lib/python3.7/site-packages/PyInstaller-3.5-py3.7.egg/PyInstaller/fake-modules'
49655 INFO: Processing pre-safe import module hook urllib3.packages.six.moves
92475 INFO: Loading module hooks...
92476 INFO: Loading module hook "hook-sphinx.py"...
/user/neonbadak/anaconda3/lib/python3.7/site-packages/sphinx/websupport/__init__.py:25: RemovedInSphinx20Warning: sphinx.websupport module is now provided as sphinxcontrib-websupport. sphinx.websupport will be removed at Sphinx-2.0. Please use the package instead.
RemovedInSphinx20Warning)
102618 INFO: Loading module hook "hook-xml.dom.domreg.py"...
102621 INFO: Loading module hook "hook-sqlalchemy.py"...
103064 INFO: Found 4 sqlalchemy hidden imports
103066 WARNING: Hidden import "MySQLdb" not found!
103067 WARNING: Hidden import "sqlalchemy.sql.functions.func" not found!
103101 INFO: Excluding import 'sqlalchemy.testing'
103112 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.orm.util
103113 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.testing
103113 INFO: Removing import of sqlalchemy.testing.mock from module sqlalchemy.testing
103113 INFO: Removing import of sqlalchemy.testing.exclusions from module sqlalchemy.testing
103113 INFO: Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing
103114 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing
103114 INFO: Removing import of sqlalchemy.testing.assertsql from module sqlalchemy.testing
103114 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing
103114 INFO: Removing import of sqlalchemy.testing.engines from module sqlalchemy.testing
103114 INFO: Removing import of sqlalchemy.testing.warnings from module sqlalchemy.testing
103114 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.config
103114 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.mock
103115 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.testing.assertions
103115 INFO: Removing import of sqlalchemy.testing.mock from module sqlalchemy.testing.assertions
103115 INFO: Removing import of sqlalchemy.testing.exclusions from module sqlalchemy.testing.assertions
103115 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.assertions
103115 INFO: Removing import of sqlalchemy.testing.assertsql from module sqlalchemy.testing.assertions
103115 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.assertions
103115 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.assertsql
103116 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.util
103116 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.util
103116 INFO: Removing import of sqlalchemy.testing.engines from module sqlalchemy.testing.util
103116 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.engines
103116 INFO: Removing import of sqlalchemy.testing.util from module sqlalchemy.testing.engines
103116 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.engines
103117 INFO: Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing.engines
103120 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.exclusions
103120 INFO: Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.exclusions
103120 INFO: Removing import of sqlalchemy.testing from module sqlalchemy.testing.warnings
103120 INFO: Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing.warnings
103121 INFO: Loading module hook "hook-nbformat.py"...
103152 INFO: Loading module hook "hook-sqlite3.py"...
103265 INFO: Loading module hook "hook-IPython.py"...
103323 INFO: Excluding import 'gtk'
103332 INFO: Excluding import 'PyQt4'
103339 INFO: Removing import of PyQt4 from module IPython.external.qt_loaders
103340 INFO: Excluding import 'PyQt5'
103346 INFO: Removing import of PyQt5.QtCore from module IPython.external.qt_loaders
103346 INFO: Removing import of PyQt5 from module IPython.external.qt_loaders
103346 INFO: Removing import of PyQt5.QtSvg from module IPython.external.qt_loaders
103346 INFO: Removing import of PyQt5.QtGui from module IPython.external.qt_loaders
103347 INFO: Removing import of PyQt5.QtWidgets from module IPython.external.qt_loaders
103347 INFO: Excluding import 'PySide'
103353 INFO: Removing import of PySide from module IPython.external.qt_loaders
103354 INFO: Excluding import 'matplotlib'
103360 INFO: Removing import of matplotlib from module IPython.core.pylabtools
103360 INFO: Removing import of matplotlib.figure from module IPython.core.pylabtools
103360 INFO: Removing import of matplotlib._pylab_helpers from module IPython.core.pylabtools
103360 INFO: Removing import of matplotlib.pyplot from module IPython.core.pylabtools
103362 INFO: Loading module hook "hook-numpy.py"...
103364 INFO: Loading module hook "hook-PyQt5.py"...
120445 WARNING: Hidden import "PyQt5.sip" not found!
120445 INFO: Loading module hook "hook-matplotlib.py"...
121063 INFO: Loading module hook "hook-notebook.py"...
124324 INFO: Loading module hook "hook-PyQt5.QtSvg.py"...
124614 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
124670 INFO: Loading module hook "hook-lxml.etree.py"...
124673 INFO: Loading module hook "hook-PIL.py"...
124681 INFO: Excluding import 'tkinter'
124684 INFO: Import to be excluded not found: 'FixTk'
124684 INFO: Excluding import 'PyQt4'
124687 INFO: Removing import of PyQt4 from module PIL.ImageQt
124687 INFO: Excluding import 'PyQt5'
124690 INFO: Removing import of PyQt5.QtGui from module PIL.ImageQt
124690 INFO: Removing import of PyQt5.QtCore from module PIL.ImageQt
124690 INFO: Excluding import 'PySide'
124693 INFO: Removing import of PySide from module PIL.ImageQt
124693 INFO: Loading module hook "hook-pydoc.py"...
124695 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
124696 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
124900 INFO: Loading module hook "hook-lib2to3.py"...
124919 INFO: Loading module hook "hook-nbconvert.py"...
124986 INFO: Loading module hook "hook-pytz.py"...
125226 INFO: Loading module hook "hook-xml.py"...
125228 INFO: Loading module hook "hook-pygments.py"...
127436 INFO: Loading module hook "hook-matplotlib.backends.py"...
128523 INFO: Matplotlib backend "GTK3Agg": ignored
cairo backend requires that cairocffi or pycairo is installed
129194 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that cairocffi or pycairo is installed
129906 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (/user/neonbadak/anaconda3/lib/python3.7/site-packages/matplotlib/backends/__init__.py)
132630 INFO: Matplotlib backend "nbAgg": added
133658 INFO: Matplotlib backend "Qt4Agg": added
134318 INFO: Matplotlib backend "Qt4Cairo": ignored
cairo backend requires that cairocffi or pycairo is installed
135049 INFO: Matplotlib backend "Qt5Agg": added
135706 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that cairocffi or pycairo is installed
136394 INFO: Matplotlib backend "TkAgg": added
137189 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that cairocffi or pycairo is installed
137832 INFO: Matplotlib backend "WebAgg": added
138709 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
139170 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
139827 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
140282 INFO: Matplotlib backend "agg": added
141105 INFO: Matplotlib backend "cairo": ignored
cairo backend requires that cairocffi or pycairo is installed
141834 INFO: Matplotlib backend "pdf": added
142716 INFO: Matplotlib backend "pgf": added
143179 INFO: Matplotlib backend "ps": added
143851 INFO: Matplotlib backend "svg": added
144603 INFO: Matplotlib backend "template": added
145066 INFO: Loading module hook "hook-pycparser.py"...
145069 INFO: Loading module hook "hook-sysconfig.py"...
145085 INFO: Loading module hook "hook-babel.py"...
145349 INFO: Loading module hook "hook-zmq.py"...
147784 INFO: Loading module hook "hook-cryptography.py"...
148313 INFO: Loading module hook "hook-distutils.py"...
148317 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
148445 INFO: Loading module hook "hook-certifi.py"...
148449 INFO: Loading module hook "hook-scipy.py"...
148452 INFO: Loading module hook "hook-jsonschema.py"...
148465 INFO: Loading module hook "hook-pkg_resources.py"...
149651 INFO: Processing pre-safe import module hook win32com
149932 INFO: Loading module hook "hook-_tkinter.py"...
150165 INFO: checking Tree
150243 INFO: checking Tree
150301 INFO: Loading module hook "hook-pytest.py"...
152414 INFO: Loading module hook "hook-setuptools.py"...
153990 INFO: Loading module hook "hook-docutils.py"...
156694 INFO: Loading module hook "hook-jedi.py"...
156758 INFO: Loading module hook "hook-encodings.py"...
156917 INFO: Loading module hook "hook-PIL.Image.py"...
157844 INFO: Loading module hook "hook-jinja2.py"...
157868 INFO: Loading module hook "hook-numpy.core.py"...
158059 INFO: MKL libraries found when importing numpy. Adding MKL to binaries
158072 INFO: Loading module hook "hook-gevent.py"...
158411 INFO: Determining a mapping of distributions to packages...
368388 WARNING: Unable to find package for requirement greenlet from package gevent.
368388 INFO: Packages required by gevent:
[]
371351 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
371359 INFO: Excluding import 'tkinter'
371362 INFO: Import to be excluded not found: 'FixTk'
371489 INFO: checking Tree
371811 INFO: Looking for ctypes DLLs
372140 WARNING: library user32 required via ctypes not found
373074 INFO: Analyzing run-time hooks ...
373117 INFO: Including run-time hook 'pyi_rth_traitlets.py'
373124 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
373130 INFO: Including run-time hook 'pyi_rth__tkinter.py'
373133 INFO: Including run-time hook 'pyi_rth_pkgres.py'
373136 INFO: Including run-time hook 'pyi_rth_certifi.py'
373139 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
373141 INFO: Including run-time hook 'pyi_rth_mpldata.py'
373143 INFO: Including run-time hook 'pyi_rth_pyqt5.py'
373208 INFO: Looking for dynamic libraries
ldd: Warning: (sth written in Korean) `/user/neonbadak/anaconda3/plugins/platforms/../../lib/libgcc_s.so.1'
378343 INFO: Looking for eggs
378343 INFO: Python library not in binary dependencies. Doing additional searching...
378366 INFO: Using Python library /user/neonbadak/anaconda3/lib/libpython3.7m.so
378423 INFO: Warnings written to /user/neonbadak/002.GUIDevelopment/code/build/segfault_strippedcode/warn-segfault_strippedcode.txt
378773 INFO: Graph cross-reference written to /user/neonbadak/002.GUIDevelopment/code/build/segfault_strippedcode/xref-segfault_strippedcode.html
379184 INFO: checking PYZ
379213 INFO: Building because toc changed
379213 INFO: Building PYZ (ZlibArchive) /user/neonbadak/002.GUIDevelopment/code/build/segfault_strippedcode/PYZ-00.pyz
383447 INFO: Building PYZ (ZlibArchive) /user/neonbadak/002.GUIDevelopment/code/build/segfault_strippedcode/PYZ-00.pyz completed successfully.
383576 INFO: checking PKG
383577 INFO: Building because toc changed
383577 INFO: Building PKG (CArchive) PKG-00.pkg
383699 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
383703 INFO: Bootloader /user/neonbadak/anaconda3/lib/python3.7/site-packages/PyInstaller-3.5-py3.7.egg/PyInstaller/bootloader/Linux-64bit/run
383703 INFO: checking EXE
383705 INFO: Building because toc changed
383705 INFO: Building EXE from EXE-00.toc
383720 INFO: Appending archive to ELF section in EXE /user/neonbadak/002.GUIDevelopment/code/build/segfault_strippedcode/segfault_strippedcode
383911 INFO: Building EXE from EXE-00.toc completed successfully.
383951 INFO: checking COLLECT
384002 INFO: Building COLLECT COLLECT-00.toc
433891 INFO: Building COLLECT COLLECT-00.toc completed successfully.
I expect the distributable to work in the same manner as the original code, without the segmentation error. Any help/hints on how to solve this issue directly or tracking down the fault itself would be greatly appreciated.

Pyinstaller not finding pandas hook

I have written a simple python script that I am now trying to make an exe file. Whenever I try to run the resulting exe, the program fails at import pandas and I get the following error.
Traceback (most recent call last):
File "myProgram.py", line 14, in <module>
import pandas
File "c:\temp\pip-install-k4pegh\pyInstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\pandas\__init__.py", line 35, in <module>
ImportError: C extension: No module named tslib not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
[492] Failed to execute script myProgram
Looking at the cmd output, hook-pandas is loaded. So this is not an issue with pyinstaller finding the pandas hook.
30240 INFO: Loading module hook "hook-pkg_resources.py"...
30568 INFO: Processing pre-safe import module hook win32com
31036 INFO: Loading module hook "hook-pytz.py"...
31286 INFO: Loading module hook "hook-pywintypes.py"...
31550 INFO: Loading module hook "hook-setuptools.py"...
31644 INFO: Loading module hook "hook-encodings.py"...
33516 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
33516 INFO: Loading module hook "hook-numpy.core.py"...
33609 INFO: Loading module hook "hook-sqlite3.py"...
33796 INFO: Loading module hook "hook-pandas.py"...
33812 INFO: Loading module hook "hook-win32com.py"...
34779 INFO: Loading module hook "hook-pythoncom.py"...
35217 INFO: Analyzing run-time hooks ...
35231 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
35247 INFO: Including run-time hook 'pyi_rth__tkinter.py'
35263 INFO: Including run-time hook 'pyi_rth_pkgres.py'
35279 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
I did have to add pandas-hook to Python27\Lib\site-packages\PyInstaller\hooks myself. See No module named 'pandas._libs.tslibs.timedeltas' in PyInstaller and https://github.com/lneuhaus/pyinstaller/commit/017b247064f9bd51a620cfb2172c05d63fc75133. Could that be a problem?
Earlier I also tried altering the spec file based on this question, PyInstaller and Pandas, with no luck.
Using:
python 2.7
pyinstaller 3.3.1
pandas 0.22.0.
If anyone knows why pyinstaller can't use a loaded hook or has any ideas as to what to try next, I would really appreciate it.

Categories