2

Has anyone tried using newspaper3k python library on AWS Elastic Beanstalk Python 3.4? I'm getting a strange error, despite images.py existing in the newspaper directory.

Traceback (most recent call last):
File "/opt/python/current/app/application.py", line 12, in <module>
     from server.helper import get_connection, requires_auth, validate_schema, error_handler
   File "/opt/python/current/app/server/helper.py", line 13, in <module>
     from database.user import User
   File "/opt/python/current/app/database/user.py", line 11, in <module>
     from .post import Post
   File "/opt/python/current/app/database/post.py", line 9, in <module>
     from newspaper import Article
   File "/opt/python/run/venv/lib/python3.4/site-packages/newspaper/__init__.py", line 10,in <module>
     from .api import (build, build_article, fulltext, hot, languages,
   File "/opt/python/run/venv/lib/python3.4/site-packages/newspaper/api.py", line 14, in <module>
     from .article import Article
   File "/opt/python/run/venv/lib/python3.4/site-packages/newspaper/article.py", line 14, in <module>
     from . import images
 ImportError: cannot import name 'images'

I have installed all dependencies (Pillow, lxml, libjpeg etc.) correctly and surprisingly when I ssh to instance it works properly.

Any help would be appreciated, thanks!

  • try from `PIL import Image` – user10089632 Sep 03 '17 at 17:46
  • @user10089632 thanks for answersing, but I don't need the Image library, I need the Article class. The error occurs when importing `from newspaper import Article` when the newspaper3k tries to import its internal module images.py – Maciej Szpakowski Sep 03 '17 at 18:43
  • Yeah, I know, I just thought there is some dependency, and Article module is loading the image module, so if you can change the line that import the image module, that may solve this error. – user10089632 Sep 03 '17 at 18:49

0 Answers0