[IPython-User] Problem importing *

Fernando Perez fperez.net@gmail....
Wed Oct 27 22:00:43 CDT 2010


On Wed, Oct 27, 2010 at 2:48 AM, Simon Heisterkamp <simon@heisterkamp.dk> wrote:
>
> In ipython i do the following:
> In [1]: from ROOT import *
> (Bool_t)1
> In [2]: g=TGraph()
> ...
> NameError: name 'TGraph' is not defined
> So for some reason this does not work in ipython. Why not?

This is exceedingly weird. I've never seen this kind of behavior, and
I'm having a hard time imagining what could cause it.  IPython simply
executes the statement

from ROOT import *

when you type it in, with code like

exec user_code in user_namespace

where user_namespace is simply the dict that holds your user variables.

I can only wonder if ROOT is doing something strange in its top-level
__init__ method that causes it to behave differently in ipython.

You may have more luck by asking the python ROOT bindings authors, but
if it turns out there's a bug on our side we'll be happy to fix it
(given enough info to know what to do, of course).

If anyone else has a clue, by all means pitch in :)

Cheers,

f


More information about the IPython-User mailing list