Install/import of jsonschemaparser fails
Expected Behavior
A successful install via
pip install git+https://jugit.fz-juelich.de/iek-10/public/ict-platform/fiware-applications/jsonschemaparser.git
and a successful import and instantiation as in
from jsonschemaparser import JsonSchemaParser
if __name__ == '__main__':
my_parser = JsonSchemaParser()
should work.
Current Behavior
The installation works for Python 3.7
, 3.9
and 3.11
and jsonschemaparser
versions v0.6.0-pre
, beta
and latest
(main
I assume). However when I want to use JsonSchemaParser
object as in the code snippet above, I get the following error:
C:\Users\f.redder\PycharmProjects\pythonProject3\venv\Scripts\python.exe C:\Users\f.redder\PycharmProjects\pythonProject3\test.py
Traceback (most recent call last):
File "C:\Users\f.redder\PycharmProjects\pythonProject3\test.py", line 1, in <module>
from jsonschemaparser import JsonSchemaParser
File "C:\Users\f.redder\PycharmProjects\pythonProject3\venv\lib\site-packages\jsonschemaparser\__init__.py", line 1, in <module>
from .parser import JsonSchemaParser
File "C:\Users\f.redder\PycharmProjects\pythonProject3\venv\lib\site-packages\jsonschemaparser\parser.py", line 12, in <module>
from .models import DataModel, Identifier
ModuleNotFoundError: No module named 'jsonschemaparser.models'
Process finished with exit code 1
This hold for all mentioned versions I tried.
Possible Solution
Refactor all intra-package imports from realtive
to absoulte
ones.
Steps to Reproduce
- Set-up a new PyCharm Project.
- Add new local Python interpreter in
venv
. - Run
pip install git+https://jugit.fz-juelich.de/iek-10/public/ict-platform/fiware-applications/jsonschemaparser.git
inside thevenv
- Run the provided code snippet.