调皮博士 发表于 2016-10-22 14:05:05

关于name ‘easygui’is not defined的问题

import urllib.request as ur
import urllib.parse as up
import re
import easygui as e
import socket
from bs4 import BeautifulSoup



如上,已经安装好了easygui模块,但是import引用的时候会提示easygui没有定义,请问这个怎么处理?

另外我用pip,easy_install和从官网下载的方法各装了一次easygui会不会有什么影响?

jsjyyjs 发表于 2016-10-22 22:32:01

这个问题好

调皮博士 发表于 2016-10-23 11:18:08

碰碰运气,看看今天有没有大神知道怎么办。

学习Python中 发表于 2016-11-13 22:17:09

下个升级完整安装包就行!我看到谷歌上老外也在做这个提问,老外最后的解决方案就是给这个安装包升级。完整的升级包再按照甲鱼老师给的方法解决就非常容易了。
https://sourceforge.net/projects/easygui/?source=typ_redirect

njqijie 发表于 2018-6-30 12:53:40

我也出现这个问题 搞了

njqijie 发表于 2018-6-30 13:16:58

怎么解决这个问题?:???

lcwsky 发表于 2022-3-25 10:13:05

这么 解决的啊?我搞了 半天没弄好。Visual Studio Code ,Python 3.10 (32-bit)里面效果一样。
python.exe setup.py install
orpip install easygui
or python.exe -m pip install --upgrade pipand \ pip install pygame
or pip install --user easygui

结局一样!

除了IDLE (Python 3.10 32-bit)可以外:
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec6 2021, 18:54:59) on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import easygui
>>> easygui.msgbox('我是你爸爸 !')
'OK'
>>>
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec6 2021, 18:54:59) on win32
Type "help", "copyright", "credits" or "license()" for more information.

====================== RESTART: E:/156u4/new proj/temp3.py =====================
Traceback (most recent call last):
File "E:/156u4/new proj/temp3.py", line 1, in <module>
    import easygui
File "E:\156u4/new proj\easygui\__init__.py", line 3, in <module>
    __all__ = easygui.__all__
NameError: name 'easygui' is not defined
页: [1]
查看完整版本: 关于name ‘easygui’is not defined的问题