openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

Error when running on travis #164

Closed boxerab closed 4 years ago

boxerab commented 4 years ago

Hi Johan,

Sorry to bother you again ! This is no doubt a configuration issue, but I am getting the following error when running jpylyzer on travis:

Traceback (most recent call last):
  File "/Users/travis/build/GrokImageCompression/grok/jpylyzer/jpylyzer.py", line 46, in <module>
    from . import config
ValueError: Attempted relative import in non-package

This error did not occur with version 1.17.

Have you encountered this error before ?

Thanks so much, Aaron

bitsgalore commented 4 years ago

Hard to say without any details on how you're calling jpylyzer in your workflow (which platform? did you install with pip? are you calling jpylyzer from another Python module?).

If you installed jpylyzer as a package with pip this shouldn't happen at all. If you just downloaded + unpacked the source repo without installing (not recommended, but OK) you will get this error if you directly run the jpylyzer.py script (this is not a bug, but simply due to how relative imports work in Python 3). As a workaround you could try calling the cli.py script in the repo's root dir, which correctly imports the module. But it's better to avoid this mess altogether and do a pip install instead.

boxerab commented 4 years ago

Thanks, yes, I am using the non-recommended approach. On windows, osx and linux. I did try using pip, but there are lots of issues with the path. So, I will stick with unpacking from source, but I will try cli.py on non-windows.