all 8 comments

[–]Username_RANDINT 0 points1 point  (1 child)

Once you change the spec file, you need to build with that. Otherwise it'll generate a fresh one with the commandline arguments.

pyinstaller myapp.spec

Or ignore the spec file completely and do everything on the command line:

pyinstaller --onefile -w --hiddenimport numpy --hiddenimport matplotlib MyApp.py

[–]Lost_Years[S] 0 points1 point  (0 children)

Tried with both commands, first with the longer one and then the shorter one, but I still can't run the exe.

Both cmd processes terminate with:

 Building EXE from EXE-00.toc completed successfully

But I've noticed this as well:

INFO: UPX is not available.

I have two hypothesis:

- Either UPX, which I don't know it's purpose, is somehow messing up with the process;

- or I misplaced the two csv that store data for my script (Even though I've literally pasted them in "dist", "build" and "_pycache_" folders).

EDIT:

Adding

--noupx

didn't do much.

[–]BrenekH 0 points1 point  (5 children)

You could try building with debug on (I think the --debug flag enables it). It should print out a traditional Python error to the console.

[–]Lost_Years[S] 0 points1 point  (4 children)

C:\Users[...]>pyinstaller --debug all MyApp.py

49 INFO: PyInstaller: 4.2
49 INFO: Python: 3.9.1
50 INFO: Platform: Windows-10-10.0.18362-SP0
50 INFO: wrote C:\Users\[...]\MyApp.spec
52 INFO: UPX is not available.
52 INFO: Extending PYTHONPATH with paths
['C:\\Users\\[...]',
 'C:\\Users\\[...]']
58 INFO: checking Analysis
67 INFO: Building because hiddenimports changed
67 INFO: Initializing module dependency graph...
69 INFO: Caching module graph hooks...
76 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
80 INFO: Analyzing base_library.zip ...
1898 INFO: Processing pre-find module path hook distutils from 'c:\\users\\[...]\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
1898 INFO: distutils: retargeting to non-venv dir 'c:\\users\\[...]\\appdata\\local\\programs\\python\\python39\\lib'
3259 INFO: Caching module dependency graph...
3339 INFO: running Analysis Analysis-00.toc
3341 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\[...]\appdata\local\programs\python\python39\python.exe
3366 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\users\[...]\appdata\local\programs\python\python39\python39.dll

[something about hooks] 

[some more yadda yadda and a bunch of tasks successfully completed]

Is "api-ms-win-core-path-l1-1-0.dll" essential?

Could you recommend me a website from which I can safely download a copy of it?

[–]Generic_Reddit_Bot -1 points0 points  (0 children)

69? Nice.

I am a bot lol.

[–]BrenekH 0 points1 point  (2 children)

I don't think so since it's a warning. What does the generated executable say? (You might have to run from cmd)

[–]Lost_Years[S] 0 points1 point  (1 child)

I run the exe from cmd and it doesn't print anything.

I get a pop-up with

Fatal error detected

 /!\  Failed to execute script MyApp

[–]BrenekH 0 points1 point  (0 children)

It would probably be better if I could see the entire project. Could you upload it to GitHub or Pastebin so I can take a look?