Python33,Flask:启动Hello World时出错很多
我刚刚在我的Windows系统上安装了pip flask和HTML5。当我开始打招呼的时候-在Firefox的一个新标签页中,我用空闲程序获得正确的文本。但是Python shell中也有很多错误消息:Python33,Flask:启动Hello World时出错很多,python,windows,flask,Python,Windows,Flask,我刚刚在我的Windows系统上安装了pip flask和HTML5。当我开始打招呼的时候-在Firefox的一个新标签页中,我用空闲程序获得正确的文本。但是Python shell中也有很多错误消息: Traceback (most recent call last): File "<frozen importlib._bootstrap>", line 1519, in _find_and_load_unlocked AttributeError: '
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1519, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\werkzeug\utils.py", line 18, in <module>
from html.entities import name2codepoint
ImportError: No module named 'html.entities'; html is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Public/python/testflask.py", line 13, in <module>
from flask import Flask
File "C:\Python33\lib\site-packages\flask\__init__.py", line 17, in <module>
from werkzeug.exceptions import abort
File "C:\Python33\lib\site-packages\werkzeug\__init__.py", line 154, in <module>
__import__('werkzeug.exceptions')
File "C:\Python33\lib\site-packages\werkzeug\exceptions.py", line 71, in <module>
from werkzeug.wrappers import Response
File "C:\Python33\lib\site-packages\werkzeug\wrappers.py", line 36, in <module>
from werkzeug.utils import cached_property, environ_property, \
File "C:\Python33\lib\site-packages\werkzeug\utils.py", line 20, in <module>
from htmlentitydefs import name2codepoint
ImportError: No module named 'htmlentitydefs'
回溯(最近一次呼叫最后一次):
文件“”,第1519行,在“查找”和“加载”中解锁
AttributeError:“模块”对象没有属性“\u_路径”
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“C:\Python33\lib\site packages\werkzeug\utils.py”,第18行,在
从html.entities导入name2codepoint
ImportError:没有名为“html.entities”的模块;html不是一个包
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“C:/Users/Public/python/testflask.py”,第13行,在
从烧瓶进口烧瓶
文件“C:\Python33\lib\site packages\flask\\uuuu init\uuuuu.py”,第17行,在
从werkzeug.exceptions导入中止
文件“C:\Python33\lib\site packages\werkzeug\\uuuuu init\uuuuuu.py”,第154行,在
__导入(werkzeug.exceptions)
文件“C:\Python33\lib\site packages\werkzeug\exceptions.py”,第71行,在
来自werkzeug.wrappers导入响应
文件“C:\Python33\lib\site packages\werkzeug\wrappers.py”,第36行,在
从werkzeug.utils导入缓存的属性、环境属性、\
文件“C:\Python33\lib\site packages\werkzeug\utils.py”,第20行,在
从htmlentitydefs导入name2codepoint
ImportError:没有名为“htmlentitydefs”的模块
救命啊!救命啊!救命啊 您有一个本地html.py
模块或html
包,它屏蔽了内置库。重命名它,因为它破坏了依赖标准库版本的软件
您可以找到需要重命名或移动的文件:
import html
print(html)
将该文件重命名为其他文件。考虑到可能还有一个
.pyc
文件;删除.pyc
字节码缓存(如果存在)。是否有名为html
或html.py
的本地目录或文件?是:c:\users\surfkonto\pictures\aldi bestellsoftware\htmlAnd是Python路径上的目录;e、 g.是sys.path
中的c:\users\surfkonto\pictures\aldi bestellsoftware
还是您当前的工作目录;在烧瓶文件顶部打印(html),查看打印内容。如果该目录或文件不在“C:\Python33\lib”中,请重命名该目录或文件。我被打印出来:亲爱的Martijn,shell中的答案是*在运行抱歉,我自己犯了很多错误:@user3891230:现在您删除了另一个文件,您不再需要导入或print(html)
行。如果你有新问题,问新问题。