2022-09-26 16:52:54 +03:00
|
|
|
import os, subprocess
|
2022-09-26 16:07:29 +03:00
|
|
|
import yaml
|
|
|
|
|
|
|
|
print (os.getcwd)
|
|
|
|
|
|
|
|
try:
|
|
|
|
with open("environment.yaml") as file_handle:
|
2022-10-07 09:32:54 +03:00
|
|
|
environment_data = yaml.safe_load(file_handle, Loader=yaml.FullLoader)
|
2022-09-26 16:07:29 +03:00
|
|
|
except FileNotFoundError:
|
|
|
|
try:
|
|
|
|
with open(os.path.join("..", "environment.yaml")) as file_handle:
|
2022-10-07 09:32:54 +03:00
|
|
|
environment_data = yaml.safe_load(file_handle, Loader=yaml.FullLoader)
|
2022-09-26 16:07:29 +03:00
|
|
|
except:
|
|
|
|
pass
|
2022-10-07 09:32:54 +03:00
|
|
|
|
2022-09-26 16:07:29 +03:00
|
|
|
try:
|
|
|
|
for dependency in environment_data["dependencies"]:
|
|
|
|
package_name, package_version = dependency.split("=")
|
|
|
|
os.system("pip install {}=={}".format(package_name, package_version))
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2022-09-26 16:52:54 +03:00
|
|
|
try:
|
2022-10-07 09:32:54 +03:00
|
|
|
subprocess.run(['python', '-m', 'streamlit', "run" ,os.path.join("..","scripts/webui_streamlit.py"), "--theme.base dark"], stdout=subprocess.DEVNULL)
|
2022-09-26 16:52:54 +03:00
|
|
|
except FileExistsError:
|
2022-10-07 09:32:54 +03:00
|
|
|
subprocess.run(['python', '-m', 'streamlit', "run" ,"scripts/webui_streamlit.py", "--theme.base dark"], stdout=subprocess.DEVNULL)
|