Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import problems on Beanstalk

See original GitHub issue

Hi all, Has anyone tried using this great library on AWS Elastic Beanstalk Python 3.4. I’m getting a strange error, despite existing in the newspaper directory.

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

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

codelucascommented, Sep 20, 2017

Very cool, nicely done getting it to work @jebudas! I not familiar with .ebextensions or beanstalk installation process. Weird that you needed to run chmod yourself too.

Hmm do you think you can help in adding an installation section for AWS Elastic Beanstalk so other beanstalk users can avoid the same problems you ran into? 👍 🙇

jebudascommented, Sep 20, 2017

Got it working! I had to add these to certain .ebextensions files:

packages: yum: libjpeg-turbo-devel: [] libxslt-devel: [] libxml2-devel: []

04_setup_newspaper: command: mkdir -p /home/wsgi/.newspaper_scraper/memoized && chmod 755 /home/wsgi/.newspaper_scraper/memoized

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Elastic Beanstalk - Unable to import local file
I've been trying to deploy a Python (Flask framework) backend via Elastic Beanstalk. Here's my error ...
Read more >
AWS Elastic Beanstalk settings issue when importing ... - GitHub
I'm trying import Elastic beanstalk existing environment. I added basic settings in the configuration file to check why it isn't working.
Read more >
Resolve the error when Amazon EC2 instances fail to ...
When I try to create an AWS Elastic Beanstalk environment, I get the following error: "The EC2 instances failed to communicate with AWS...
Read more >
Error running on aws / beanstalk - usage - Prodigy Support
Hi. I am troubleshooting an issue I'm running into in attempting to import prodigy from a django app view on an ec2 instance...
Read more >
AWS Elastic beanstalk python install error in latest Amazon ...
AWS Elastic beanstalk python install error in latest Amazon Linux 2/3.3.12 ... line 9, in <module> from setuptools import convert_path, find_packages, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found