Weird relative import resolution error in python 3.2.3 -
Weird relative import resolution error in python 3.2.3 -
i encoutner next import resolution error in programme of mine:
i am: homie.translators.is24.rest.translator traceback (most recent phone call last): file "/usr/local/sbin/is24rest", line 3, in <module> homie.interfaces.is24.rest import __main__ file "/usr/local/lib/python3.2/dist-packages/homie/interfaces/is24/rest/__init__.py", line 8, in <module> .exporter import exporter file "/usr/local/lib/python3.2/dist-packages/homie/interfaces/is24/rest/exporter.py", line 12, in <module> homie.translators.is24.rest.translator import translator file "/usr/local/lib/python3.2/dist-packages/homie/translators/is24/rest/translator.py", line 9, in <module> .factories.rest.restfactory import restfactory importerror: no module named factories.rest.restfactory
the content of /usr/local/lib/python3.2/dist-packages/homie/translators/is24/rest/translator.py
is
""" created on 18.06.2014 @author: richard neumann """ print('i am: ' + str(__name__)) homie.translators.abc import translator t .factories.rest.restfactory import restfactory .factories.openimmo.openimmofactory import openimmofactory class translator(t): <snip>
also, relative module exists:
root@srv:/usr/src/is24-translator# ls /usr/local/lib/python3.2/dist-packages/homie/translators/is24/rest/factories/rest/ abc.py attachments __init__.py __pycache__ realestates restfactory.py
why python3 seek absolute import here? encounter problem under debian 7 python 3.2.3. under arch w/ python 3.4.1 works fine.
am missing something?
there __init__.py missing in .factories
, caused error. took me while realize that.
python python-3.x import relative-import
Comments
Post a Comment