pip-helper/computer_install.pyw

43 lines
1005 B
Python
Raw Normal View History

2023-05-06 22:53:43 +08:00
from tkinter import *
from tkinter import messagebox
import os
root = Tk()
ml = os.getcwd()
file_error = '文件丢失,请重新安装'
ok = '安装完成'
install = 'pip install'
# def
def tensorFlow():
os.system('pip install TensorFlow')
messagebox.showinfo(install, ok)
def pytorch():
os.system('pip install pytorch')
messagebox.showinfo(install, ok)
2023-05-08 18:07:42 +08:00
def openai():
os.system('pip install openai')
messagebox.showinfo(install, ok)
2023-05-06 22:53:43 +08:00
def fh():
root.destroy()
# Button
bt_tensorFlow = Button(root, text='TensorFlow安装', command=tensorFlow)
bt_pytorch = Button(root, text='pytorch安装', command=pytorch)
2023-05-08 18:07:42 +08:00
bt_openai = Button(root, text='openai安装', command=openai)
2023-05-06 22:53:43 +08:00
bt_fh = Button(root, text='返回', command=fh)
# pack
Label(root, text='机器学习类库安装').pack()
bt_tensorFlow.pack()
bt_pytorch.pack()
2023-05-08 18:07:42 +08:00
bt_openai.pack()
2023-05-06 22:53:43 +08:00
bt_fh.pack()
# mainloop
root.title('install')
root.geometry('150x150+400+700')
root.mainloop()