Forum >> Programmazione Python >> IDE ed Editor >> Passaggio eseguibile creato in Python

Pagina: 1

Buongiorno a tutti,
mi chiamo Donato e sono un programmatore PLC ed esperienza pari a zero con Python :py:. Per un progetto ho dovuto scrivere un codice Python per passare la posizione di una ruota filtri (dispositivo HID) ad un PLC Siemens della serie 1200. Lavorando sul PC di sviluppo ( Windows 11 x64 ) su IDE PyCharm Community Edition (2023.1.4) con interprete Python 3.10.7 ho scritto, collaudato e convertito il codice in formato.exe utilizzando "pyinstaller --onefile".
Fin qui tutto ok, ma quando passo l'exe sul PC del cliente (Windows 11 x64, IDE PyCharm Community Edition (2023.1.4), Python 3.10.7) mi ritrovo il codice che gira benissimo in IDE ma l'eseguibile non funziona, come mai?

Utilizzo all'interno dello script (In Allegato) le librerie snap7.dll e HID.

Grazie in anticipo.
Allegati
Messaggio nascosto da Daniele aka Palmux :
SPAM
It appears that the problem you're facing is dependency-related, with snap7.dll and HID libraries. When you run your Python script through PyInstaller to convert it into an executable, it bundles your code but in some cases does not include all required dynamic libraries or dependencies automatically. This can result in problems if running the .exe on another machine, particularly if such libraries are not installed in the same location or are not being bundled properly. To avoid this, ensure that the necessary DLL files (such as snap7.dll) and any dependencies are specifically mentioned in the PyInstaller spec file or are stored in the same directory as the executable. Also, make sure that the system of the customer has the same version of Python and required libraries installed. You may also consider looking at the PyInstaller documentation for how you can include such external libraries at build time.





--- Ultima modifica di williamclark in data 2025-05-07 07:28:26 ---


Pagina: 1



Esegui il login per scrivere una risposta.