怎么解决用vs code 调用easygui中的函数时显示没有函数的问题

怎么解决用vs code 调用easygui中的函数时显示没有函数的问题

问题描述:

想在vscode 上调用easygui里面的msgbox函数,结果报错:
发生异常: AttributeError
module 'easygui' has no attribute 'msgbox

用在vs code上用dir()检查easygui,发现只有这样:
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'easygui']

但在IDLE上显示是这样:
['EgStore', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'abouteasygui', 'boolbox', 'boxes', 'buttonbox', 'ccbox', 'choicebox', 'codebox', 'diropenbox', 'eg_version', 'egdemo', 'egversion', 'enterbox', 'exceptionbox', 'fileopenbox', 'filesavebox', 'indexbox', 'integerbox', 'msgbox', 'multchoicebox', 'multenterbox', 'multpasswordbox', 'passwordbox', 'read_or_create_settings', 'textbox', 'ynbox']

求问各路大神如何解决vscode不能调用easygui中函数,感激不尽!

建议你使用原来的Tkinter

import Tkinter as tk #Python 2.x
import tkinter as tk #Python 3.x

def msg(massege):
    win = tk.Tk()
    a = tk.Label(win, text=massege)
    a.pack()
    win.mainloop()

msg("Hello")