You can disable the pylab/numpy imports with the config:<div><br></div><div>IPKernelApp.pylab_import_all = False</div><div><br></div><div>Everything will still work fine.<br><br><div class="gmail_quote">On Fri, Jul 27, 2012 at 12:34 PM, Junkshops <span dir="ltr"><<a href="mailto:junkshops@gmail.com" target="_blank">junkshops@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
<blockquote type="cite">
<div><br>
</div>
<div>Are you sure that you're not telling IPython to do that in
your config files? For example, you might have the pylab value
set in your ipython_notebook_config.py:</div>
<div><br>
</div>
<div> c.IPKernelApp.pylab = 'inline'</div>
</blockquote></div>
That's the problem - I start the notebook server with the
--pylab=inline option to allow for matplotlib graphics to show up
inline as per the documentation:
<a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html</a><br>
<br>
I don't understand what the option does other than that, so I didn't
realize that it came with side effects like those below. I don't
suppose there's any way to set the notebook up so plots are
displayed inline without masking the builtin functions? If not,
would <br>
<br>
any = __builtins__.any<br>
all = __builtins__.all<br>
<br>
possibly break the inline plotting?<br>
<br>
Cheers, g<div><div class="h5"><br>
<br>
<br>
On 7/27/2012 11:48 AM, Tony Yu wrote:
</div></div><blockquote type="cite"><div><div class="h5"><br>
<br>
<div class="gmail_quote">On Fri, Jul 27, 2012 at 2:37 PM,
Junkshops <span dir="ltr"><<a href="mailto:junkshops@gmail.com" target="_blank">junkshops@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-bash-4.1$ python<br>
Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47)<br>
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2<br>
Type "help", "copyright", "credits" or "license" for more
information.<br>
>>> any<br>
<built-in function any><br>
>>> all<br>
<built-in function all><br>
<br>
-bash-4.1$ ipython<br>
Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47)<br>
Type "copyright", "credits" or "license" for more information.<br>
<br>
IPython 0.13 -- An enhanced Interactive Python.<br>
*snip*<br>
<br>
In [1]: any<br>
Out[1]: <function any><br>
<br>
In [2]: all<br>
Out[2]: <function all><br>
<br>
In a new notebook:<br>
In [1]: any<br>
<br>
Out[1]: <function numpy.core.fromnumeric.any><br>
<br>
In [2]: all<br>
<br>
Out[2]: <function numpy.core.fromnumeric.all><br>
<br>
For some reason the builtins are masked by the numpy functions
even when<br>
numpy isn't explicitly imported.<br>
<br>
-g<br>
<br>
</blockquote>
<div><br>
</div>
<div>Are you sure that you're not telling IPython to do that in
your config files? For example, you might have the pylab value
set in your ipython_notebook_config.py:</div>
<div><br>
</div>
<div> c.IPKernelApp.pylab = 'inline'</div>
<div><br>
</div>
<div>-Tony</div>
<div> </div>
</div>
<br>
<br>
<fieldset></fieldset>
<br>
</div></div><div class="im"><pre>_______________________________________________
IPython-User mailing list
<a href="mailto:IPython-User@scipy.org" target="_blank">IPython-User@scipy.org</a>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a>
</pre>
</div></blockquote>
</div>
<br>_______________________________________________<br>
IPython-User mailing list<br>
<a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
<br></blockquote></div><br></div>