简体   繁体   中英

ImportError when installing newspaper

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移动到此目录,并在此目录中放置一个空白__init__.py来解决此问题。

I know this is a dated entry, but to anyone else that faced the same issue as me, I initially fumbled with resolving this issue. When I first run import newspaper , I faced this error. lxml runtime error: Reason: Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

When I tried to re-run my code (without correcting anything), I got the error found on this article. I have no idea why this was the case, and I wasn't able to resolve my issue using the above method (it didn't work for me, but it could still work for you). If anyone was fumbling like me on Jupyter on getting newspaper to work, do consider the link below. Hope this is helpful.

https://stackoverflow.com/a/31607751/6143792

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM