[IPython-User] Warning when running code with 'import gtk'

Alejandro Weinstein alejandro.weinstein@gmail....
Mon Nov 14 15:57:06 CST 2011


Hi:

I get a warning when I use IPython to run a script that import the gtk
module. I have the following file:

###### foo.py #######
import gtk
### end of file #####

If I do

$ ipython foo.py

or

In [1]: %run foo.py

I get the warning

/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()

Running the script with the standard python interpreter ($ python
foo.py) produce no warning. Also, if I do the 'import gtk' inside
IPython (instead of running the script with %run), I get no warning.

I have a fresh install of Lubuntu 10.10 and IPython 0.11 (installed using pip).

Any idea about how to avoid the warning?

Alejandro.


More information about the IPython-User mailing list