-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.py
29 lines (24 loc) · 998 Bytes
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os.path
import subprocess
metashape_exe = rf"C:\\Program Files\\Agisoft\\Metashape Pro\\python\\python.exe"
assert os.path.exists(metashape_exe), "Metashape executable not found"
requirements = ["numpy==1.21.4",
"azure-identity",
"azure-ai-ml",
"azure-cli",
"pyqt5",
"./packages/Metashape-2.1.2-cp37.cp38.cp39.cp310.cp311-none-win_amd64.whl"]
# Define the command to install the requirements
commands = [metashape_exe,
'-m',
'pip',
'install',
*requirements]
# Use subprocess to run the command in the terminal
result = subprocess.run(commands, shell=True, capture_output=True)
# Check if the command was successful and output the result
if result.returncode == 0:
print("Requirements installed successfully!")
else:
print("Failed to install requirements. Error message:")
print(result.stdout.decode() if result.stdout else result.stderr.decode())