added module check
parent
5eeabda3af
commit
f616d1daa4
20
main.py
20
main.py
|
@ -1,6 +1,24 @@
|
|||
import sys
|
||||
# Justus Jan Nico Wolff
|
||||
sys.dont_write_bytecode = True
|
||||
import subprocess
|
||||
import pkg_resources
|
||||
import ast
|
||||
|
||||
required = open("requirements.txt", 'r')
|
||||
required = ast.literal_eval(required.read())
|
||||
installed = {pkg.key for pkg in pkg_resources.working_set}
|
||||
missing = required - installed
|
||||
|
||||
if missing:
|
||||
while True:
|
||||
ans = input(f"Einige benötigte Module sind nicht installiert ({missing}), installieren per pip? Y/N ")
|
||||
if ans == "y":
|
||||
python = sys.executable
|
||||
subprocess.check_call([python, '-m', 'pip', 'install', *missing], stdout=subprocess.DEVNULL)
|
||||
break
|
||||
elif ans == "n":
|
||||
exit()
|
||||
import mtTkinter as tk
|
||||
from tkinter import ttk as tkk
|
||||
from tkinter import messagebox
|
||||
|
@ -34,8 +52,6 @@ else:
|
|||
if len(sys.argv) == 2:
|
||||
if sys.argv[1] == "NOLANG":
|
||||
replacelh()
|
||||
import ast
|
||||
import subprocess
|
||||
import time
|
||||
import shutil
|
||||
import os
|
||||
|
|
|
@ -1 +1 @@
|
|||
["easygui", "simpleaudio", "tkinter"]
|
||||
{"easygui", "simpleaudio"}
|
Loading…
Reference in New Issue