Skip to content


Improve absolute import management for #60

ipython opened this Issue · 1 comment

2 participants


Original Launchpad bug 506112:
Reported by: fdo.perez (Fernando Perez).

On Mon, Jan 11, 2010 at 11:36 AM, Jörgen Stenarson wrote:

I often run IPython/testing/ as a script but this is not possible
now due to a relative import:

> C:\python\external\ipython-perez\IPython>python testing\
> Traceback (most recent call last):
>  File "testing\", line 39, in 
>    from . import globalipapp
> ValueError: Attempted relative import in non-package

Argh, yes. This is unfortunately only fixed for 2.6:

We might just add that boilerplate

if __name__ == "__main__" and __package__ is None:
    __package__ = ""

protected by a version check, so your approach continues to work.

IPython: interactive computing in Python member

This is now fixed in master, closing.

@fperez fperez closed this
@damianavila damianavila referenced this issue
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.