本文介绍了安装报纸时出现ImportError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对python很陌生,正在尝试导入报纸以提取文章.每当我尝试导入模块时,都会得到ImportError: cannot import name images.有人遇到这个问题并找到了解决方案吗?

I am pretty new to python and am trying to import newspaper for article extraction. Whenever I try to import the module I get ImportError: cannot import name images. Anyone come across this problem and found a solution?

推荐答案

我能够通过以下方法解决此问题:在/usr/local/lib/python2.7/dist-packages/newspaper中创建一个images目录,将images.py移至该目录,并放置一个空白的在此目录中.

I was able to fix this problem by creating an images directory in /usr/local/lib/python2.7/dist-packages/newspaper , moving images.py to this directory, and placing a blank __init__.py in this directory.

这篇关于安装报纸时出现ImportError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 22:25