python-jsonpath installs into the jsonpath/ namespace in site-packages, which conflicts with the existing jsonpath package (by Phil Budne, published since 2008).
When both are installed in the same environment (e.g., as transitive dependencies), python-jsonpath's jsonpath/ directory shadows the original jsonpath.py module. Code that does from jsonpath import jsonpath (the original package's API) breaks with:
ImportError: cannot import name 'jsonpath' from 'jsonpath'
This is happening in practice: kr8s depends on python-jsonpath, and projects that also depend on the original jsonpath encounter this collision.
Reproduction:
pip install jsonpath==0.82.2 python-jsonpath
python -c "from jsonpath import jsonpath"
# ImportError: cannot import name 'jsonpath' from 'jsonpath'
Suggestion:
Would you consider using a non-colliding import namespace, such as python_jsonpath or pyjsonpath? This would allow python-jsonpath to coexist with the original jsonpath package. The current situation makes it impossible to have both in the same environment, even indirectly via transitive dependencies.
I understand this would be a breaking change for existing users. A migration path could include a major version bump and a compatibility shim that re-exports the new namespace from the old one for a deprecation period.
python-jsonpathinstalls into thejsonpath/namespace in site-packages, which conflicts with the existing jsonpath package (by Phil Budne, published since 2008).When both are installed in the same environment (e.g., as transitive dependencies),
python-jsonpath'sjsonpath/directory shadows the originaljsonpath.pymodule. Code that doesfrom jsonpath import jsonpath(the original package's API) breaks with:ImportError: cannot import name 'jsonpath' from 'jsonpath'This is happening in practice: kr8s depends on
python-jsonpath, and projects that also depend on the originaljsonpathencounter this collision.Reproduction:
pip install jsonpath==0.82.2 python-jsonpathpython -c "from jsonpath import jsonpath"# ImportError: cannot import name 'jsonpath' from 'jsonpath'Suggestion:
Would you consider using a non-colliding import namespace, such as
python_jsonpathorpyjsonpath? This would allowpython-jsonpathto coexist with the originaljsonpathpackage. The current situation makes it impossible to have both in the same environment, even indirectly via transitive dependencies.I understand this would be a breaking change for existing users. A migration path could include a major version bump and a compatibility shim that re-exports the new namespace from the old one for a deprecation period.