Thanks, I read it and try to put my code in the correct form, but now give me another error, inside the Writer Package says: "ValueError: Attempted relative import in non-package", if somebody knows a clue of how fix it i will glad to read opinions. [?]
On Thu, Feb 4, 2010 at 2:11 AM, Gabriel Genellina <gagsl-...@yahoo.com.ar>wrote: > En Thu, 04 Feb 2010 01:00:56 -0300, Hidura <hid...@gmail.com> escribió: > > > Good evening list, I have a really big trouble with the imports in the 3.1 >> version(Notes: In the older 2.64 theres no problems), I have two packages, >> the first package Utilities who contains Writer the second package, >> Writers >> contain the module tagmanip(What is imported in the best way inside the >> __init__.py of the Writer), when i make the import inside the writer >> everything is ok, but from the Utilities package the errors says: >> "ImportError: No module named tagsmanip". >> I don't understand why this is happening, if somebody could help me i will >> glad to hear any suggestion. >> > > In Python 3.x, "absolute" import is enabled by default (2.6 uses a mix of > relative and absolute imports). > To import sibling modules in a package, or modules in a subpackage, you > have to use relative imports: > > from . import tagmanip > from .Writers import tagmanip > > See PEP328 http://www.python.org/dev/peps/pep-0328/ > > -- > Gabriel Genellina > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Hidura
<<330.png>>
-- http://mail.python.org/mailman/listinfo/python-list