Seite 1 von 1

Bekomme pyinstaller nicht zum Laufen

Verfasst: Mittwoch 19. Februar 2025, 22:42
von tigerpython78
Moin,

ich verzweifle gerade dabei, auf meinem neuen Rechner (Win 11) pyinstaller korrekt zu installieren. Bin noch eher Python-Neuling, also sorry falls ich einen Anfängerfehler mache.

Ich nutze VSCode und habe über dessen PowerShell-Terminal pyinstaller installiert mit

pip install -U pyinstaller

Wenn ich das jetzt nochmal ausführe, kommt u. a.

Requirement already satisfied: pyinstaller in c:\users\...(restlicher Pfad)

D. h. es scheint installiert zu sein. Wenn ich jetzt aber

pyinstaller testtool.spec

ausführe, kommt

pyinstaller : Die Benennung "pyinstaller" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt.
Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ pyinstaller mbaExcelTool.spec
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (pyinstaller:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


Wenn ich im Explorer zum pyinstaller-Pfad gehe, der mir oben angezeigt wurde, sehe ich dort einige Ordner von installierten Erweiterungen, z. B. pip, openpyxl und auch pyinstaller. Pip funktioniert, pyinstaller nicht.
Muss da irgendwas in den PATH? Auf meinem alten Rechner ist es das nicht, außerdem gibt es in den Ordnern der Erweiterungen ja auch keine ausführbare Dateien.

Kann mir jemand sagen was ich falsch mache?

Re: Bekomme pyinstaller nicht zum Laufen

Verfasst: Donnerstag 20. Februar 2025, 11:25
von sparrow
Stichwort für die Recherche: venv (virtual environment).

Re: Bekomme pyinstaller nicht zum Laufen

Verfasst: Donnerstag 20. Februar 2025, 20:32
von tigerpython78
Erstmal danke für die Antwort.
Auf meinem alten Rechner hatte ich (jedenfalls anscheinend) das gleiche Setup wie jetzt, und da brauchte ich keine venv. Das geht doch auch ohne, oder nicht?

Re: Bekomme pyinstaller nicht zum Laufen

Verfasst: Freitag 21. Februar 2025, 07:41
von noisefloor
Hallo,

venv ist besser, aber nein, es ist nicht zwingend.

Ich verstehe den Installationsweg noch nicht gang. Hast du pyinstaller via Powershell installiert oder aus VS Code heraus? Wenn letzteres: kann es sein, das VS Code implizit automatisch ein venv anlegt (ich nutze kein VS Code).

Zu zeigt wenn möglich mal bitte den vollen Pfad von "Requirement already satisfied: pyinstaller in c:\users\...(restlicher Pfad)".

Gruß, noisefloor

Re: Bekomme pyinstaller nicht zum Laufen

Verfasst: Montag 24. Februar 2025, 22:53
von tigerpython78
Sorry, komme jetzt erst zum Antworten.

VS Code hat ein integriertes Powershell-Terminal. Das ist nichts anderes als würde ich Powershell direkt nutzen.

Die komplette von pip install -U pyinstaller ist:

Requirement already satisfied: pyinstaller in c:\users\me\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (6.12.0)
Requirement already satisfied: setuptools>=42.0.0 in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\lib\site-packages (from pyinstaller) (65.5.0)
Requirement already satisfied: altgraph in c:\users\me\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from pyinstaller) (0.17.4)
Requirement already satisfied: pyinstaller-hooks-contrib>=2025.1 in c:\users\me\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from pyinstaller) (2025.1)
Requirement already satisfied: packaging>=22.0 in c:\users\me\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from pyinstaller) (24.2)
Requirement already satisfied: pefile!=2024.8.26,>=2022.5.30 in c:\users\me\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from pyinstaller) (2023.2.7)
Requirement already satisfied: pywin32-ctypes>=0.2.1 in c:\users\me\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from pyinstaller) (0.2.3)

Re: Bekomme pyinstaller nicht zum Laufen

Verfasst: Dienstag 25. Februar 2025, 07:15
von sparrow
tigerpython78 hat geschrieben: Montag 24. Februar 2025, 22:53VS Code hat ein integriertes Powershell-Terminal. Das ist nichts anderes als würde ich Powershell direkt nutzen.
Diese Aussage ist nur bedingt richtig. Die Shell innerhalb von VSC kann eine andere Umgebung haben als außerhalb von VSC. Eben zum Beispiel ein venv aktivieren oder Pfade umbiegen.

Deshalb würde ich das erst einmla außerhalb versuchen.

Also etwas in der Art:

Code: Alles auswählen

py -m venv tempvenv
tempvenv\scripts\activate
python -m pip install pyinstaller
pyinstaller

Re: Bekomme pyinstaller nicht zum Laufen

Verfasst: Dienstag 25. Februar 2025, 21:25
von tigerpython78
Ok, wo muss ich das denn ausführen? Wo ist die ausführbare py? Im PATH bisher jedenfalls nicht.