Hi,

I have a multi-file/folder project developed with python 3.12/pycharm 
running on win11.

I build a onefile exe with pyinstaller with the following command 
(pyinstaller 6.8.0):

 

*pyinstaller --onefile IO_Analysis.py --add-data "SIOT_2019.xlsx;." 
--add-data "Results;." --add-data "src;." --add-data "Temp_Results;." 
--add-data "Manual;."*


If I run the exe from the original pc, either from the HD or from a USB 
drive, it works fine. If a move the set of files/folders in a different pc 
(win 10 without python/pycharm installation) either in the HD ot in the USB 
drive, the exe works only partially: it finds the pdf manual or the xls 
input file but gives the error in the object if I ask for some calculation. 
the call for 'numpy' is not in the main file (IO_Analysis.py) but in all 
the files in the 'src' folder.



To try to solve, I have tested the building of the exe with some additional 
variants: i) adding the import of numpy in the main file; ii) adding the 
‘--hidden-import’ option; iii) adding the ‘--paths’ option; iv) updating to 
the latest version of python and modules and using a new virtual 
environment via a ‘requirements.txt’ file, but nothing changed.

 

In addition, even if the “warning” text file reports some missing modules, 
it does not mention ‘numpy’.

Any idea of the possible solution to fix the problem?

Thank you

 

 

Below the log of the building.

 


(myvenv) C:\Users\...omissis...\ITA_PIOA>pyinstaller --onefile 
IO_Analysis.py --add-data "SIOT_2019.xlsx;." --add-data "Results;." 
--add-data "src;." --add-data "Temp_Results;." --add-data "Manual;." 
396 INFO: PyInstaller: 6.8.0, contrib hooks: 2024.7 
396 INFO: Python: 3.12.0 
427 INFO: Platform: Windows-11-10.0.22631-SP0 
427 INFO: Python environment: C:\Users\...omissis...\ITA_PIOA\myvenv 
427 INFO: wrote C:\Users\...omissis...\ITA_PIOA\IO_Analysis.spec 
427 INFO: Module search paths (PYTHONPATH): 
['C:\\Users\\...omissis...\\ITA_PIOA\\myvenv\\Scripts\\pyinstaller.exe', 
'C:\\Users\\Fioramanti_Marco\\AppData\\Local\\Programs\\Python\\Python312\\python312.zip',
 

'C:\\Users\\Fioramanti_Marco\\AppData\\Local\\Programs\\Python\\Python312\\DLLs',
 

'C:\\Users\\Fioramanti_Marco\\AppData\\Local\\Programs\\Python\\Python312\\Lib',
 

'C:\\Users\\Fioramanti_Marco\\AppData\\Local\\Programs\\Python\\Python312', 
'C:\\Users\\...omissis...\\ITA_PIOA\\myvenv', 
'C:\\Users\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages', 
'C:\\Users\\...omissis...\\ITA_PIOA'] 
840 INFO: Appending 'datas' from .spec 
845 INFO: checking Analysis 
845 INFO: Building Analysis because Analysis-00.toc is non existent 
845 INFO: Running Analysis Analysis-00.toc 
845 INFO: Target bytecode optimization level: 0 
845 INFO: Initializing module dependency graph... 
846 INFO: Caching module graph hooks... 
868 INFO: Analyzing base_library.zip ... 
2455 INFO: Loading module hook 'hook-heapq.py' from 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks'...
 

2563 INFO: Loading module hook 'hook-encodings.py' from 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks'...
 

4822 INFO: Loading module hook 'hook-pickle.py' from 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks'...
 

6566 INFO: Caching module dependency graph... 
6739 INFO: Looking for Python shared library... 
6739 INFO: Using Python shared library: 
C:\Users\Fioramanti_Marco\AppData\Local\Programs\Python\Python312\python312.dll 

6739 INFO: Analyzing C:\Users\...omissis...\ITA_PIOA\IO_Analysis.py 
6896 INFO: Loading module hook 'hook-_tkinter.py' from 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks'...
 

6896 INFO: Processing module hooks... 
6896 INFO: Loading module hook 'hook-_tkinter.py' from 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks'...
 

6896 INFO: checking Tree 
6896 INFO: Building Tree because Tree-00.toc is non existent 
6896 INFO: Building Tree Tree-00.toc 
6975 INFO: checking Tree 
6975 INFO: Building Tree because Tree-01.toc is non existent 
6975 INFO: Building Tree Tree-01.toc 
6990 INFO: checking Tree 
6990 INFO: Building Tree because Tree-02.toc is non existent 
6990 INFO: Building Tree Tree-02.toc 
7006 INFO: Performing binary vs. data reclassification (942 entries) 
7194 INFO: Looking for ctypes DLLs 
7210 INFO: Analyzing run-time hooks ... 
7210 INFO: Including run-time hook 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
 

7210 INFO: Including run-time hook 
'C:\\...omissis...\\ITA_PIOA\\myvenv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
 

7241 INFO: Looking for dynamic libraries 
7445 INFO: Extra DLL search directories (AddDllDirectory): [] 
7445 INFO: Extra DLL search directories (PATH): [] 
7649 INFO: Warnings written to 
C:\Users\...omissis...\ITA_PIOA\build\IO_Analysis\warn-IO_Analysis.txt 
7666 INFO: Graph cross-reference written to 
C:\Users\...omissis...\ITA_PIOA\build\IO_Analysis\xref-IO_Analysis.html 
7712 INFO: checking PYZ 
7712 INFO: Building PYZ because PYZ-00.toc is non existent 
7712 INFO: Building PYZ (ZlibArchive) 
C:\Users\...omissis...\ITA_PIOA\build\IO_Analysis\PYZ-00.pyz 
8089 INFO: Building PYZ (ZlibArchive) 
C:\Users\...omissis...\ITA_PIOA\build\IO_Analysis\PYZ-00.pyz completed 
successfully. 
8120 INFO: checking PKG 
8120 INFO: Building PKG because PKG-00.toc is non existent 
8120 INFO: Building PKG (CArchive) IO_Analysis.pkg 
11732 INFO: Building PKG (CArchive) IO_Analysis.pkg completed successfully. 
11773 INFO: Bootloader 
C:\Users\...omissis...\ITA_PIOA\myvenv\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\run.exe
 

11773 INFO: checking EXE 
11773 INFO: Building EXE because EXE-00.toc is non existent 
11773 INFO: Building EXE from EXE-00.toc 
11773 INFO: Copying bootloader EXE to 
C:\Users...omissis...\ITA_PIOA\dist\IO_Analysis.exe 
11794 INFO: Copying icon to EXE 
11810 INFO: Copying 0 resources to EXE 
11810 INFO: Embedding manifest in EXE 
11826 INFO: Appending PKG archive to EXE 
11857 INFO: Fixing EXE headers 
12030 INFO: Building EXE from EXE-00.toc completed successfully.

-- 
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/699c9cb9-cfd4-41c1-8877-bc383d2c9f40n%40googlegroups.com.

Reply via email to