pip = sh.Command(os.path.join(sys.exec_prefix,"bin","pip"))
< /code>
Got < /p>
No module named 'fcntl'
< /code>
Ich habe versucht, es auf diese Weise zu ersetzen. < /p>
def pip(*args):
result = subprocess.run(
[sys.executable, "-m", "pip"] + list(args),
capture_output=True,
text=True
)
if result.returncode != 0:
raise Exception(f"Pip command failed: {result.stderr}")
return result.stdout.strip()
< /code>
Ich habe [url=viewtopic.php?t=19803]Fehler erhalten[/url] < /p>
File "C:\Applics\Python 3.9\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Applics\Python 3.9\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Applics\Python 3.9\lib\subprocess.py", line 1360, in _execute_child
args = list2cmdline(args)
File "C:\Applics\Python 3.9\lib\subprocess.py", line 565, in list2cmdline
for arg in map(os.fsdecode, seq):
File "C:\Applics\Python 3.9\lib\os.py", line 822, in fsdecode
filename = fspath(filename)
< /code>
Wenn ich < /p>
ausführepip("install",tuple("--upgrade"))
< /code>
Ich habe es auf Ubuntu ausprobiert und es funktioniert gut. < /p>
def run_pip(*args):
"""Run pip with the given arguments"""
cmd = [sys.executable, "-m", "pip"] + list(args)
return subprocess.run(cmd, capture_output=True, text=True)
result = run_pip("list")
print(result.stdout)
Ich leite Code unter Windows aus und habe diese Zeile < /p> [code]pip = sh.Command(os.path.join(sys.exec_prefix,"bin","pip")) < /code> Got < /p> No module named 'fcntl' < /code> Ich habe versucht, es auf diese Weise zu ersetzen. < /p> def pip(*args): result = subprocess.run( [sys.executable, "-m", "pip"] + list(args), capture_output=True, text=True ) if result.returncode != 0: raise Exception(f"Pip command failed: {result.stderr}") return result.stdout.strip() < /code> Ich habe [url=viewtopic.php?t=19803]Fehler erhalten[/url] < /p> File "C:\Applics\Python 3.9\lib\subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "C:\Applics\Python 3.9\lib\subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Applics\Python 3.9\lib\subprocess.py", line 1360, in _execute_child args = list2cmdline(args) File "C:\Applics\Python 3.9\lib\subprocess.py", line 565, in list2cmdline for arg in map(os.fsdecode, seq): File "C:\Applics\Python 3.9\lib\os.py", line 822, in fsdecode filename = fspath(filename) < /code> Wenn ich < /p> ausführepip("install",tuple("--upgrade")) < /code> Ich habe es auf Ubuntu ausprobiert und es funktioniert gut. < /p> def run_pip(*args): """Run pip with the given arguments""" cmd = [sys.executable, "-m", "pip"] + list(args) return subprocess.run(cmd, capture_output=True, text=True)
result = run_pip("list") print(result.stdout) [/code] Es sieht so aus>
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
setuid() to 1000
your processes number limit is 5568
your memory page...
Ich versuche, einen Befehlsjob auszuführen, der in einem Datenanlagen gelesen und für weitere ML -Aufgaben eine Vorverarbeitung durchführt. /Code> Datei Ich habe den Code im Abschnitt Consum wie...
Ich versuche, ein Googletrans -Paket zu importieren, aber ich habe einen ModulenotFounderror erhalten, wenn ich versuche, es zu importieren, obwohl ich es installiert habe. 11 #to translate the text...