I get a warning when running code with ipython, but not with python

Hi:

I just installed matplolib from source code, and Ipython using pip, in
Ubuntu 11.10.

When I run this code

########### foo.py ############
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()

···

##############################

in ipython, I get the following warning:

In [1]: %run foo.py
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:54: Warning:
ignoring sys.argv: it must be a list of strings
  _gtk.init_check()

Other than the warning the plot looks OK.

Also, if I type each sentence in ipython, I don't get the warning. I
don't get a warning if I use the standard python interpreter either
(as in $ python foo.py).

Any clue about this? Should I report this in the Ipython mailing list?

I am running Ipython 0.11 and matplotlib 1.2.x.

Alejandro

This looks like a bug for the IPython folks. If you make a file containing only "import gtk" and "%run" that file, one gets the same error.

Mike

···

On 11/13/2011 10:30 PM, Alejandro Weinstein wrote:

Hi:

I just installed matplolib from source code, and Ipython using pip, in
Ubuntu 11.10.

When I run this code

########### foo.py ############
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()
##############################

in ipython, I get the following warning:

In [1]: %run foo.py
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:54: Warning:
ignoring sys.argv: it must be a list of strings
   _gtk.init_check()

Other than the warning the plot looks OK.

Also, if I type each sentence in ipython, I don't get the warning. I
don't get a warning if I use the standard python interpreter either
(as in $ python foo.py).

Any clue about this? Should I report this in the Ipython mailing list?

I am running Ipython 0.11 and matplotlib 1.2.x.

Alejandro

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Mmmh, I don't get the problem on ubuntu 10.10. I'll try to check
later on an 11.10 machine I have.

To the OP: yes, this will be best discussed on the ipython list, since
it really has nothing to do with matplotlib.

Cheers,

f

···

On Mon, Nov 14, 2011 at 6:11 AM, Michael Droettboom <mdroe@...86...> wrote:

This looks like a bug for the IPython folks. If you make a file
containing only "import gtk" and "%run" that file, one gets the same error.

It is a bug of IPython 0.11. The problem is solved in 0.12.

See http://mail.scipy.org/pipermail/ipython-user/2011-November/008734.html
for the details.

Alejandro.

···

On Mon, Nov 14, 2011 at 7:11 AM, Michael Droettboom <mdroe@...86...> wrote:

This looks like a bug for the IPython folks. If you make a file
containing only "import gtk" and "%run" that file, one gets the same error.