mikeroberts3000 / flashlight

Flashlight is a lightweight Python library for analyzing and solving quadrotor control problems.
http://mikeroberts3000.github.io/flashlight
48 stars 13 forks source link

failed to import module _transformations #3

Closed arlk closed 3 years ago

arlk commented 8 years ago

When running any file that imports transformations.py. I get a user warning which says that it failed to run line 1902:

/home/arun/git_projs/flashlight/code/lib/flashlight/transformations.py:1888: UserWarning: failed to import module _transformations
  warnings.warn("failed to import module %s" % name)
mikeroberts3000 commented 8 years ago

@arunlakshmanan Thanks for raising this issue. I get that warning too. It's safe to ignore.

This warning occurs because flashlight/transformations.py is actually a third party file I downloaded from somewhere, it issues this warning, and I haven't bothered to disable it. As far as I know, the module it is trying (and failing) to load is a fast C version of some of the functions in flashlight/transformations.py. If it can't load the fast C version, it falls back to the Python version, which is plenty fast enough for my typical use cases.

It would be better to temporarily disable warnings when importing transformations.py, or better yet, to get ahold of the fast C version. In the meantime, this behavior is somewhat documented, because that warning is visible in the examples, and the examples work correctly. But I'll leave this issue open as a reminder to fix this in a cleaner way in the next release.

mikeroberts3000 commented 3 years ago

I've decided to close this issue because the relevant workarounds are documented here, and it will be a while before I get a chance to further improve the documentation.