-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost_install.py
More file actions
25 lines (20 loc) · 771 Bytes
/
Copy pathpost_install.py
File metadata and controls
25 lines (20 loc) · 771 Bytes
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
import os
import subprocess
import sys
def check_dependency(command, name):
try:
subprocess.check_call([command, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(f"{name} is installed.")
except subprocess.CalledProcessError:
print(f"Warning: {name} is not installed.")
except FileNotFoundError:
print(f"Warning: {name} is not found in the system path.")
def main():
# Check for g++
check_dependency('g++', 'g++')
# Check for python3
check_dependency('python3', 'python3')
# Additional instructions for the user to update config.py
print("\nIf you encounter issues, ensure that the paths for python3 and g++ are correctly set in config.py.")
if __name__ == "__main__":
main()