Spaces:
Runtime error
Runtime error
pip req
Browse files
app.py
CHANGED
|
@@ -1,25 +1,19 @@
|
|
| 1 |
-
import subprocess
|
| 2 |
import os
|
| 3 |
|
| 4 |
# 定义命令列表(每个命令作为一个子进程运行)
|
| 5 |
commands = [
|
| 6 |
-
"cd
|
| 7 |
-
"cd
|
| 8 |
-
"cd
|
| 9 |
-
"cd
|
| 10 |
-
"
|
| 11 |
]
|
| 12 |
|
| 13 |
# 执行所有命令
|
| 14 |
for cmd in commands:
|
| 15 |
try:
|
| 16 |
-
|
| 17 |
-
# 使用 shell=True 以支持 && 和 cd 等shell功能
|
| 18 |
-
result = subprocess.run(cmd, shell=True, check=True,
|
| 19 |
-
stdout=subprocess.PIPE,
|
| 20 |
-
stderr=subprocess.PIPE,
|
| 21 |
-
text=True)
|
| 22 |
-
print(result.stdout)
|
| 23 |
except subprocess.CalledProcessError as e:
|
| 24 |
print(f"Command failed: {cmd}")
|
| 25 |
print(f"Error: {e.stderr}")
|
|
|
|
| 1 |
+
import subprocess, shlex
|
| 2 |
import os
|
| 3 |
|
| 4 |
# 定义命令列表(每个命令作为一个子进程运行)
|
| 5 |
commands = [
|
| 6 |
+
"cd JarvisIR && pip install -r requirements.txt",
|
| 7 |
+
"cd JarvisIR/package/agent_tools/Retinexformer && python3 setup.py develop --no_cuda_ext",
|
| 8 |
+
"cd JarvisIR/package/agent_tools/RIDCP && python3 setup.py develop",
|
| 9 |
+
"cd JarvisIR/package && pip install -e .",
|
| 10 |
+
"pip install basicsr"
|
| 11 |
]
|
| 12 |
|
| 13 |
# 执行所有命令
|
| 14 |
for cmd in commands:
|
| 15 |
try:
|
| 16 |
+
subprocess.run(shlex.split(cmd))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except subprocess.CalledProcessError as e:
|
| 18 |
print(f"Command failed: {cmd}")
|
| 19 |
print(f"Error: {e.stderr}")
|