Fernando Hidalgo
Fernando Hidalgo

Reputation: 59

Error when importing newspaper module

I'm trying to use the newspaper package on python 2 and I keep getting the error cannot import name images error when I download it.

I followed previous SO advice and created an image directory in /usr/local/lib/python2.7/site-packages/newspaper with the images.py and __init__.py files but it still doesn't work: ImportError when installing newspaper

The only difference between that advice and what I implemented is that I have site-packages instead of dist-packages. Any ideas?

Upvotes: 3

Views: 1316

Answers (1)

utengr
utengr

Reputation: 3355

Newspaper has been deprecated for Python2 and it's a buggy version according to their official documentation. You should switch to Python3 version.

Installation on Python 3:

pip3 install newspaper3k

Newspaper is a Python3 library! Or, view our deprecated and buggy Python2 branch. Run : pip3 install newspaper3k and NOT pip3 install newspaper. On python3 you must install newspaper3k, not newspaper. newspaper is our python2 library. Although installing newspaper is simple with pip, you will run into fixable issues if you are trying to install on ubuntu.

Upvotes: 1

Related Questions