Relative Imports, why the hell is it so hard?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Mar 23 12:37:28 EDT 2009


En Mon, 23 Mar 2009 13:19:51 -0300, CinnamonDonkey  
<CinnamonDonkey at googlemail.com> escribió:

> My applogies if this is a silly question... but what makes something a
> package?

A package is a directory with an __init__.py file [that Python is aware  
of].

> and does that mean that what I am trying to do is not
> possible ?

You can do an "absolute" import of subpack1 and subpack2. But you cannot  
import them "relatively" - not using your current configuration, but see  
Maxim Khitrov post for an alternate disposition that works.

-- 
Gabriel Genellina




More information about the Python-list mailing list