[Python] Compilare script con Python è possibile grazie a Nuitka

Gabriele Battaglia iz4apu a libero.it
Sab 20 Mar 2021 22:30:40 CET


Ciao Luigi.
Il progetto sembra interessante.
A me però da un errore.
Ho provato sia con l'opzione --onefile che con --standalone
In entrambi i casi ricevo un errore di accesso negato ad un file. Ed ho 
solo la console aperta, senza altri processi.
Come potrei risolvere?

Ecco l'output.

d:\Dropbox\py>nuitka --standalone cartella.py
Nuitka:INFO: Starting Python compilation.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C level backend compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: 
C:\Users\asus\AppData\Local\Nuitka\Nuitka\gcc\x86_64\10.2.0-11.0.0-8.0.0-r5\mingw64\bin\gcc.exe 
(gcc.exe).
Nuitka-Scons:INFO: Compiled 13 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache hit': 11
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 2
Traceback (most recent call last):
   File "C:\Python39\lib\site-packages\nuitka\__main__.py", line 185, in 
<module>
     main()
   File "C:\Python39\lib\site-packages\nuitka\__main__.py", line 171, in 
main
     MainControl.main()
   File "C:\Python39\lib\site-packages\nuitka\MainControl.py", line 755, 
in main
     copyUsedDLLs(
   File "C:\Python39\lib\site-packages\nuitka\freezer\Standalone.py", 
line 1102, in copyUsedDLLs
     used_dlls = detectUsedDLLs(
   File "C:\Python39\lib\site-packages\nuitka\freezer\Standalone.py", 
line 1037, in detectUsedDLLs
     worker_pool.submit(
   File 
"C:\Python39\lib\site-packages\nuitka\utils\ThreadedExecutor.py", line 
45, in submit
     self.results.append(function(*args))
   File "C:\Python39\lib\site-packages\nuitka\freezer\Standalone.py", 
line 1001, in addDLLInfo
     used_dlls = detectBinaryDLLs(
   File "C:\Python39\lib\site-packages\nuitka\freezer\Standalone.py", 
line 976, in detectBinaryDLLs
     return detectBinaryPathDLLsWindowsDependencyWalker(
   File "C:\Python39\lib\site-packages\nuitka\freezer\Standalone.py", 
line 943, in detectBinaryPathDLLsWindowsDependencyWalker
     result = detectDLLsWithDependencyWalker(binary_filename, scan_dirs)
   File "C:\Python39\lib\site-packages\nuitka\freezer\DependsExe.py", 
line 190, in detectDLLsWithDependencyWalker
     deleteFile(dwp_filename, must_exist=True)
   File "C:\Python39\lib\site-packages\nuitka\utils\FileOperations.py", 
line 307, in deleteFile
     os.unlink(path)
PermissionError: [WinError 32] Impossibile accedere al file. Il file è 
utilizzato da un altro processo: 'cartella.dist\\cartella.exe.dwp'

d:\Dropbox\py>


Maggiori informazioni sulla lista Python