ImportError when installing newspaper

前端 未结 2 1441
自闭症患者
自闭症患者 2021-01-06 13:26

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

相关标签:
2条回答
  • 2021-01-06 13:41

    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.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题