Organising packages/modules - importing functions from a common.py in a separate directory?

Jean-Michel Pichavant jeanmichel at sequans.com
Tue Oct 29 05:02:37 EDT 2013


----- Original Message -----
> Hi,
> 
> If I try to use:
> 
>     from .common.common_foo import setup_foo_logging
> 
> I get:
> 
>     ValueError: Attempted relative import in non-package

If you're using python 3, forget what I said about not using relative imports. I think they've implemented the necessary grammar to make it work.

Cheers,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Python-list mailing list