Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #6277
| From | Ulli Horlacher <framstag@rus.uni-stuttgart.de> |
|---|---|
| Newsgroups | de.comp.lang.python |
| Subject | subprocess.call() funktioniert nicht mit Windows? |
| Date | 2025-03-26 10:17 +0000 |
| Organization | University of Stuttgart, FRG |
| Message-ID | <vs0k86$ukp$1@rusnews.informatik.uni-stuttgart.de> (permalink) |
Ich hab ein Python2 Programm nach Python3 migriert, das primaer unter
Windows laufen soll. Damit die Anwender kein Python installeren muessen
(was die ueberfordern wuerde) hab ich es mit pyinstallier in ein
Executable compilert.
Starte ich mein Programm direkt mit Python, funktioniert alles, starte ich
dagegen das Executable (Doppel-Klick auf icon) bricht es mit dieser
Fehlermeldung ab:
When I compile it with pyinstaller and start the executable via
desktop-click, it throws an exception:
Traceback (most recent call last):
File "\\VBOXSRV\python\W10\fexit_20250325_1641.py", line 3468, in <module> wexit(main())
File "\\VBOXSRV\python\W10\fexit_20250325_1641.py", line 281, in main menu()
File "\\VBOXSRV\python\W10\fexit_20250325_1641.py", line 376, in menu cls()
File "\\VBOXSRV\python\W10\fexit_20250325_1641.py", line 3366, in cls
syscall('cls')
File "\\VBOXSRV\python\W10\fexit_20250325_1641.py", line 3373, in syscall
subprocess.call(cmd)
File "subprocess.py", line 345, in call
File "subprocess.py", line 966, in __init__
File "subprocess.py", line 1435, in _execute_child
OSError: [WinError 740] The requested operation requires elevation
Welche/warum "elevation"?
Die problamtische Funktion ist:
def syscall(*cmd):
cmd = ['cmd','/d','/c']+list(cmd)
subprocess.call(cmd)
Interessant ist: starte ich das Executable aus einem cmd.exe oder
cygwin/bash Window heraus laeuft es ohne Fehlermeldung bzw Abbruch.
Also eine seltsame Inkompatibilitaet von pyinstaller mit Windows?
Ich verwende Windows 10 mit:
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a Tel: ++49-711-68565868
70569 Stuttgart (Germany) WWW: https://www.tik.uni-stuttgart.de/
Back to de.comp.lang.python | Previous | Next — Next in thread | Find similar
subprocess.call() funktioniert nicht mit Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-26 10:17 +0000
[Python-de] Re: subprocess.call() funktioniert nicht mit Windows? Hartmut Goebel <h.goebel@goebel-consult.de> - 2025-03-26 22:02 +0100
Re: [Python-de] Re: subprocess.call() funktioniert nicht mit Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-26 22:35 +0000
[Python-de] Re: subprocess.call() funktioniert nicht mit Windows? Hartmut Goebel <h.goebel@goebel-consult.de> - 2025-03-27 16:24 +0100
Re: [Python-de] Re: subprocess.call() funktioniert nicht mit Windows? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2025-03-27 16:00 +0000
Re: [Python-de] Re: subprocess.call() funktioniert nicht mit Windows? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2025-03-27 09:16 +0000
Re: [Python-de] Re: subprocess.call() funktioniert nicht mit Windows? Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2025-03-27 23:31 +0000
Re: [Python-de] Re: subprocess.call() funktioniert nicht mit Windows? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2025-03-28 08:20 +0000
csiph-web