错误AttributeError: module 'urllib' has no attribute 'urlretrieve'

使用TensorFlow从Wikipedia数据构建Word嵌入模型时报错如下:

AttributeError: module 'urllib' has no attribute 'urlretrieve'

查了查原因,是python3中使用urlretrieve时应该加.request,即:

urllib.urlretrieve改为urllib.request.urlretrieve即可解决

猜你喜欢

转载自blog.csdn.net/cestlavieqiang/article/details/83628387