Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catched Import Errors #32

Open
hgn opened this issue Nov 2, 2017 · 3 comments
Open

Catched Import Errors #32

hgn opened this issue Nov 2, 2017 · 3 comments
Labels

Comments

@hgn
Copy link
Member

hgn commented Nov 2, 2017

A new setup triggered an import error where the drawing/video generation failed.

Source was this:

  try:
       from dmprsim.simulator import draw
       from PIL import Image, ImageDraw, ImageFont, ImageFilter
  except ImportError:

The exception raised from from dmprsim.simulator import draw where the origin was a missing numpy installation. So this is somewhat shitty, first, the error was hidden because of it was not clear was module was missing. The second problem was that the video generation (make promovideo) did not raised any visiable error. The error message was printed in the beginning of the video generation. Two problems.

One suggestion: we should provide under utils a function where can can check if everything required is available.

def try_probe_cairo():
    import cairo

Implemented in utils.py. That can be used everywhere so that we can say, "no video generation not possible, no cairo installed".

@hgn hgn added the bug label Nov 2, 2017
@reisub-de
Copy link
Contributor

Are you sure you installed all dependencies? We should not have to assume that the user has not installed the deps everytime we import something

@hgn
Copy link
Member Author

hgn commented Nov 3, 2017

Yes, now I installed all deps and it works like a charm. The problem was that It was not visible that I forgot to installed a dependency. No warning message really visible.

Some minutes ago I triggered a exception that video generation did not worked because ffmpeg was not installed. This was really fine because subprocess failed with ffmpeg not found. This is what the user expect if he type make promotion.

Another idea: let make the simulation depends on some modules, if not, exit and printout module foo not installed.

  • numpy
  • cairo
  • $(cat requirements.txt)

Why not in this way? This optional stuff is fine, but who cares if the user installs one or two addiitional packages via apt-get or pip?

@reisub-de
Copy link
Contributor

reisub-de commented Nov 3, 2017

That's what we made make check for, we could run the dep-check parts of that before every run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants