Hello everyone, I am building an executable for my astronomy application. When I run pyinstaller with the following parameters:
pyinstaller variabilia.py --onefile --windowed The executable file is created, but it doesn't work. This is the log file of the execution of pyinstaller 275 INFO: PyInstaller: 6.4.0, contrib hooks: 2024.1 276 INFO: Python: 3.11.8 284 INFO: Platform: Windows-10-10.0.19045-SP0 284 INFO: wrote D:\Sviluppo\fotometria\variabilia.spec 288 INFO: Extending PYTHONPATH with paths ['D:\\Sviluppo\\fotometria'] 564 INFO: checking Analysis 564 INFO: Building Analysis because Analysis-00.toc is non existent 565 INFO: Initializing module dependency graph... 569 INFO: Caching module graph hooks... 584 INFO: Analyzing base_library.zip ... 1506 INFO: Loading module hook 'hook-heapq.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 1775 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 3050 INFO: Loading module hook 'hook-pickle.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 4188 INFO: Caching module dependency graph... 4273 INFO: Running Analysis Analysis-00.toc 4274 INFO: Looking for Python shared library... 4286 INFO: Using Python shared library: C:\Program Files\Python311\python311.dll 4286 INFO: Analyzing D:\Sviluppo\fotometria\variabilia.py 4557 INFO: Loading module hook 'hook-pubsub.core.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 4750 INFO: Loading module hook 'hook-astropy.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 1187 WARNING: Failed to collect submodules for 'astropy.tests.figures' because importing 'astropy.tests.figures' raised: ModuleNotFoundError: No module named 'pytest' 8129 INFO: Loading module hook 'hook-packaging.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 8352 INFO: Loading module hook 'hook-difflib.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 8563 INFO: Loading module hook 'hook-platform.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 8580 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 8995 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 9061 INFO: Loading module hook 'hook-xml.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 9895 INFO: Loading module hook 'hook-numpy.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\numpy\\_pyinstaller'... 11548 INFO: Loading module hook 'hook-certifi.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 11556 INFO: Loading module hook 'hook-astropy_iers_data.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 12073 INFO: Loading module hook 'hook-matplotlib.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 12377 INFO: Processing pre-safe import module hook gi from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-gi.py'. 12454 INFO: Loading module hook 'hook-PIL.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 12527 INFO: Loading module hook 'hook-PIL.Image.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 13162 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 15162 INFO: Processing pre-safe import module hook six.moves from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\ hook-six.moves.py'. 16153 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 18686 INFO: Loading module hook 'hook-charset_normalizer.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 19098 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 19169 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 21551 INFO: Loading module hook 'hook-keyring.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 22050 INFO: Loading module hook 'hook-importlib_metadata.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 22165 INFO: Processing module hooks... 22223 INFO: Loading module hook 'hook-setuptools.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 23518 INFO: Processing pre-safe import module hook distutils from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-distutils.py'. 23518 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'. 23884 INFO: Loading module hook 'hook-distutils.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 23932 INFO: Loading module hook 'hook-distutils.util.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 24126 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 31623 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 32001 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 32001 INFO: Matplotlib backend selection method: automatic discovery of used backends 32083 INFO: Discovered Matplotlib backend(s) via `matplotlib.use()` call in module 'astropy.conftest': ['Agg'] 32107 INFO: The following Matplotlib backends were discovered by scanning for `matplotlib.use()` calls: ['Agg']. If your backend of choice is not in this list, either add a `matplotlib.use()` call to your code, or configure the backend collection via hook options (see: https://pyinstaller.org/en/stable/hooks-config.html#matplotlib-hooks). 32107 INFO: Selected matplotlib backends: ['Agg'] 32309 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 32395 INFO: Processing pre-safe import module hook win32com from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'. 32929 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 33519 INFO: Loading module hook 'hook-setuptools._distutils.command.check.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 33782 INFO: Performing binary vs. data reclassification (653 entries) 33963 INFO: Looking for ctypes DLLs 34107 INFO: Analyzing run-time hooks ... 34116 INFO: Including run-time hook 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py' 34118 INFO: Including run-time hook 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py' 34121 INFO: Processing pre-find module path hook _pyi_rth_utils from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-_pyi_rth_utils.py'. 34123 INFO: Loading module hook 'hook-_pyi_rth_utils.py' from 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks'... 34124 INFO: Including run-time hook 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py' 34127 INFO: Including run-time hook 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py' 34130 INFO: Including run-time hook 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_setuptools.py' 34131 INFO: Including run-time hook 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_mplconfig.py' 34178 INFO: Looking for dynamic libraries C:\Users\forte\AppData\Roaming\Python\Python311\site-packages\PyInstaller\building\build_main.py:194: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47. __import__(package) 36099 INFO: Extra DLL search directories (AddDllDirectory): ['C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\numpy.libs', 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\matplotlib.libs', 'C:\\Users\\forte\\AppData\\Roaming\\Python\\Python311\\site-packages\\matplotlib.libs'] 36099 INFO: Extra DLL search directories (PATH): [] 37175 INFO: Warnings written to D:\Sviluppo\fotometria\build\variabilia\warn-variabilia.txt 37387 INFO: Graph cross-reference written to D:\Sviluppo\fotometria\build\variabilia\xref-variabilia.html 37451 INFO: checking PYZ 37451 INFO: Building PYZ because PYZ-00.toc is non existent 37452 INFO: Building PYZ (ZlibArchive) D:\Sviluppo\fotometria\build\variabilia\PYZ-00.pyz 39736 INFO: Building PYZ (ZlibArchive) D:\Sviluppo\fotometria\build\variabilia\PYZ-00.pyz completed successfully. 39784 INFO: checking PKG 39784 INFO: Building PKG because PKG-00.toc is non existent 39785 INFO: Building PKG (CArchive) variabilia.pkg 39814 INFO: Building PKG (CArchive) variabilia.pkg completed successfully. 39815 INFO: Bootloader C:\Users\forte\AppData\Roaming\Python\Python311\site-packages\PyInstaller\bootloader\Windows-64bit-intel\run.exe 39816 INFO: checking EXE 39819 INFO: Building EXE because EXE-00.toc is non existent 39819 INFO: Building EXE from EXE-00.toc 39820 INFO: Copying bootloader EXE to D:\Sviluppo\fotometria\build\variabilia\variabilia.exe 39848 INFO: Copying icon to EXE 39855 INFO: Copying 0 resources to EXE 39855 INFO: Embedding manifest in EXE 39863 INFO: Appending PKG archive to EXE 39875 INFO: Fixing EXE headers 40079 INFO: Building EXE from EXE-00.toc completed successfully. 40085 INFO: checking COLLECT 40086 INFO: Building COLLECT because COLLECT-00.toc is non existent 40086 INFO: Building COLLECT COLLECT-00.toc 41912 INFO: Building COLLECT COLLECT-00.toc completed successfully. When I run the application, I get the following error: Traceback (most recent call last): File "variabilia.py", line 3, in <module> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module File "fotometria5.py", line 1, in <module> File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module File "photutils\__init__.py", line 98, in <module> File "photutils\__init__.py", line 90, in _get_bibtex FileNotFoundError: [Errno 2] No such file or directory: 'D:\\Sviluppo\\fotometria\\dist\\variabilia\\_internal\\photutils\\CITATION.rst' Apparently it looks like there is an error in importing the module photutils (???) Is that correct in your opinion? Do you know how I could fix this? Thanks a lot for your help :-) Nicola <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Privo di virus.www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CADMj6LBsUE5C6yci2EqY40YEsgvDfFNtORmj%3DGnWFNtoAMs%3DaQ%40mail.gmail.com.
