Python - 无法导入名称 Eve
Python - Cannot import name Eve
我正在尝试设置 Python-Eve。
我已经完成了这些步骤:
C:\Users\Ari\Desktop\rizzla>python -m pip install eve
Requirement already satisfied (use --upgrade to upgrade): eve in c:\python34\lib
\site-packages
Requirement already satisfied (use --upgrade to upgrade): cerberus<0.9,>=0.8 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): events<0.3,>=0.2.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): simplejson<4.0,>=3.3.0
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): werkzeug<0.10,>=0.9.4
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): markupsafe<1.0,>=0.23
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): jinja2<3.0,>=2.7.2 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous<1.0,>=0.2
2 in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask<0.11,>=0.10.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): pymongo<3.0,>=2.7.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask- pymongo<0.4,>=0.
3.0 in c:\python34\lib\site-packages (from eve)
但是当尝试 运行 Quick Start Guide 上的代码时,我得到
Traceback (most recent call last):
File "run.py", line 1, in <module>
from eve import Eve
File "C:\Users\Ari\Desktop\rizzla\eve.py", line 1, in <module>
from eve import Eve
ImportError: cannot import name 'Eve'
我的代码在这里:
from eve import Eve
app = Eve()
if __name__ == '__main__':
app.run()
您的脚本名称是eve
;与您要导入的模块相同。将您的脚本名称重命名为其他名称以防止冲突。
如果目录中有eve.pyc
,请删除
我正在尝试设置 Python-Eve。
我已经完成了这些步骤:
C:\Users\Ari\Desktop\rizzla>python -m pip install eve
Requirement already satisfied (use --upgrade to upgrade): eve in c:\python34\lib
\site-packages
Requirement already satisfied (use --upgrade to upgrade): cerberus<0.9,>=0.8 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): events<0.3,>=0.2.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): simplejson<4.0,>=3.3.0
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): werkzeug<0.10,>=0.9.4
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): markupsafe<1.0,>=0.23
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): jinja2<3.0,>=2.7.2 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous<1.0,>=0.2
2 in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask<0.11,>=0.10.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): pymongo<3.0,>=2.7.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask- pymongo<0.4,>=0.
3.0 in c:\python34\lib\site-packages (from eve)
但是当尝试 运行 Quick Start Guide 上的代码时,我得到
Traceback (most recent call last):
File "run.py", line 1, in <module>
from eve import Eve
File "C:\Users\Ari\Desktop\rizzla\eve.py", line 1, in <module>
from eve import Eve
ImportError: cannot import name 'Eve'
我的代码在这里:
from eve import Eve
app = Eve()
if __name__ == '__main__':
app.run()
您的脚本名称是eve
;与您要导入的模块相同。将您的脚本名称重命名为其他名称以防止冲突。
如果目录中有eve.pyc
,请删除