当前位置:首页 > 公司荣誉 >

web.py 启动时候出现AttributeError- 'module' object

编辑:北京飞炫空间展览展示有限公司 时间:2017-09-10 10:05:25阅读次数:2
web.py 启动时候出现AttributeError: 'module' object has no attribut

错误信息如下:


[plain]
Traceback (most recent call last):
File "webpy.py", line 84, in <module>
app.run()
File "D:\Python27\lib\site-packages\web\application.py", line 313, in run
return wsgi.runwsgi(self.wsgifunc(*middleware))
File "D:\Python27\lib\site-packages\web\wsgi.py", line 55, in runwsgi
server_addr = validip(listget(sys.argv, 1, ''))
File "D:\Python27\lib\site-packages\web\net.py", line 108, in validip
if validip6addr(ip): return (ip,port)
File "D:\Python27\lib\site-packages\web\net.py", line 33, in validip6addr
socket.inet_pton(socket.AF_INET6, address)
AttributeError: 'module' object has no attribute 'inet_pton'

Traceback (most recent call last):
File "webpy.py", line 84, in <module>
app.run()
File "D:\Python27\lib\site-packages\web\application.py", line 313, in run
return wsgi.runwsgi(self.wsgifunc(*middleware))
File "D:\Python27\lib\site-packages\web\wsgi.py", line 55, in runwsgi
server_addr = validip(listget(sys.argv, 1, ''))
File "D:\Python27\lib\site-packages\web\net.py", line 108, in validip
if validip6addr(ip): return (ip,port)
File "D:\Python27\lib\site-packages\web\net.py", line 33, in validip6addr
socket.inet_pton(socket.AF_INET6, address)
AttributeError: 'module' object has no attribute 'inet_pton'
解决方法,专题,修改Python安装目录下Lib\site-packages\web\net.py文件的第32到第35行为如下内容:

[python]
try:
socket.inet_pton(socket.AF_INET6, address)
except:
return False

try:
socket.inet_pton(socket.AF_INET6, address)
except:
return False

,站群软件

企业建站2800元起,携手武汉肥猫科技,做一个有见地的颜值派!更多优惠请戳:仙桃网站建设 http://xiantao.45qun.com

上一篇:新手建站首选香港主机 下一篇:最后一页

相关阅读