web.py——运行错误【AttributeError: ‘StaticApp‘ object has no attribute ‘directory‘】
問題描述
AttributeError("'StaticApp' object has no attribute 'directory'")
Traceback (most recent call last): ? File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web/wsgiserver/wsgiserver3.py",
?line 1089, in communicate
? ? ?req.respond() ? File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web/wsgiserver/wsgiserver3.py",
?line 877, in respond
? ? ?self.server.gateway(self).respond() ? File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web/wsgiserver/wsgiserver3.py",
?line 1982, in respond
? ? ?for chunk in response: ? File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/web/httpserver.py",
?line 255, in __iter__
? ? ?path = self.translate_path(self.path) ? File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/server.py",
?line 820, in translate_path
? ? ?path = self.directory
AttributeError: 'StaticApp' object has no attribute 'directory'
解決方案
升級web.py
pip install --upgrade web.pyweb.py==0.62已解決此問題?
?
參考文章
WEBPY / Serving static files : 'StaticApp Object has no attribute 'directory'
總結(jié)
以上是生活随笔為你收集整理的web.py——运行错误【AttributeError: ‘StaticApp‘ object has no attribute ‘directory‘】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python——web.py模块错误【U
- 下一篇: TensorFlow——加载和使用多个模