python - Jython fails to load modules having 'com' as top level namespace -
i have jython module com.xyz.module1
in jython site-packages directory. directory structure below.
jython2.7 |---lib |--site-packages |--com |--__init__.py |--xyz |--__init__.py |--module1 |--__init__.py
when try import com.xyz.module1
in jython interpretor, importerror
thrown (screenshot). however, import works fine when rename com.xyz.module1
foo.xyz.module1
.
i have read jython doc discourages (but not forbid) use of com
top level module namespace. jython library interested in cannot refactored not use com
top level namespace.
is there other way make import work?
i don't think so. there unresolvable conflict here between way python import works , way people name java packages.
perhaps overly simplistic, first 'com' encountered during import 1 , 'com', , prevent second 'com' being imported.
so, need take different approach when naming jython (python) packages.
Comments
Post a Comment