-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.py
More file actions
executable file
·30 lines (21 loc) · 831 Bytes
/
init.py
File metadata and controls
executable file
·30 lines (21 loc) · 831 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
26
27
28
29
30
#!/usr/bin/python3
import os
import importlib
dependencies = ['scipy', 'configparser', 'numpy', 'pandas', 'matplotlib', 'unittest', 'mat73']
def check_and_install(dependencies):
for package in dependencies:
try:
importlib.import_module(package)
print(f'{package} is already installed.')
except ImportError:
install_package = input(f'{package} is not installed. Would you like to install it? (y/n)')
if install_package.lower() == 'y':
import subprocess
subprocess.call(f'pip3 install {package}', shell=True)
else:
print(f'{package} is not installed.')
exit()
if not os.path.exists("./regrets"):
os.makedirs("regrets")
check_and_install(dependencies)
print("Set up is ready.")