Closed TechiesOfficial closed 10 months ago
Hi,
This happens because of the slightly different ways imports work in Python, depending on whether you run a Python application from an installed package, or from a script in the source distribution.
The easiest solution (and the only proper one for production use!), is to install Jpylyzer either as a Python package (using pip), or alternatively using the Windows binaries or the Debian package. See the docs for details:
https://jpylyzer.openpreservation.org/doc/latest/userManual.html#installation
In that case you can directly run jpylyzer as an executable command, without having to worry about the Python interpreter.
If you really want to run Jpylyzer from the source distribution (which seems to be what you're doing), you can use the cli.py wrapper script, which is located in the root of the repo. E.g. on Linux:
python3 ~/jpylyzer/cli.py
Result:
usage: cli.py [-h] [--format FMT] [--legacyout] [--mix {1,2}] [--nopretty]
[--nullxml] [--recurse] [--packetmarkers] [--verbose]
[--version] [--wrapper]
jp2In [jp2In ...]
cli.py: error: the following arguments are required: jp2In
Let me know if this helps!
Side note - you mention upgrading to Python 3.2. Not sure if that's a typo, but I would strongly recommend to upgrade to a more recent (3.8 or higher) version, because Python 3.2 was retired in early 2016, see overview here:
We use jython nowaday and my manager came back from vacation and created a specific package.
We will throw away jython in our next updates.
There is nothing wrong on your side.
Thank you for your time.
Hello, working for BnF, we try to update to the last jyplyzer version (2.1) using python 2.7 before migrating to 3.2.
I've seen package import definition have changed between 2.0 and 2.1 and launching jpylyzer results in:
python jpylyzer.py Traceback (most recent call last): File "jpylyzer.py", line 45, in <module> from . import config ValueError: Attempted relative import in non-package
I am not really familiar with python package definition but everything seems correct. There is a init.py file as can be seen:
boxvalidator.py byteconv.py config.py etpatch.py __init__.py jpylyzer.py jpylyzer$py.class __main__.py mix.py shared.py
I tried with a python3.6 executable that was already available on the server but same result.
Thanks.