[IPython-user] Magic function not found

Chanchal G notmuch at gmail.com
Mon Jun 20 16:55:53 CDT 2005


Not much joy. Here's the log immediately after deleting .ipython  
directory

----------------------------------------------------BEGIN  
SESSION----------------------------------------------------
Lunatic:~ chanchalg$ ipython
**********************************************************************
Welcome to IPython. I will try to create a personal configuration  
directory
where you can customize many aspects of IPython's functionality in:

/Users/chanchalg/.ipython

Successful installation!

Please read the sections 'Initial Configuration' and 'Quick Tips' in the
IPython manual (there are both HTML and PDF versions supplied with the
distribution) to make sure that your system environment is properly  
configured
to take advantage of IPython's features.
Please press <RETURN> to start IPython.
**********************************************************************
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
Type "copyright", "credits" or "license" for more information.

IPython 0.6.15 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]:

In [1]: %pdoc(Exception)
ERROR: Magic function `pdoc(Exception)` not found.

In [2]: Exception?
Type:           classobj
String Form:    exceptions.Exception
Namespace:      Python builtin
Docstring:
     Common base class for all exceptions.


In [3]: import os.path

In [4]: os.path??

In [5]: %pdoc(os.path)
ERROR: Magic function `pdoc(os.path)` not found.

In [6]: %pfile(os.path)
ERROR: Magic function `pfile(os.path)` not found.

In [7]: lsmagic
Available magic functions:
%Exit  %Pprint  %Quit  %alias  %autocall  %autoindent  %automagic  % 
bg  %bookmark  %cd  %color_info  %colors  %config  %dhist  %dirs  % 
ed  %edit  %env  %hist  %history  %logoff  %logon  %logstart  % 
logstate  %lsmagic  %macro  %magic  %p  %page  %pdb  %pdef  %pdoc  % 
pfile  %pinfo  %popd  %profile  %prun  %psource  %pushd  %pwd  %r  % 
rehash  %rehashx  %reset  %run  %runlog  %save  %sc  %sx  % 
system_verbose  %time  %unalias  %who  %who_ls  %whos  %xmode

Automagic is ON, % prefix NOT needed for magic functions.

In [8]: pdoc?
Type:           Magic function
Base Class:     <type 'instancemethod'>
String Form:    <bound method InteractiveShell.magic_pdoc of  
<IPython.iplib.InteractiveShell instance at 0x26d5a8>>
Namespace:      IPython internal
File:           /Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/IPython/Magic.py
Definition:     pdoc(self, parameter_s='')
Docstring:
     Print the docstring for an object.

     If the given object is a class, it will print both the class and  
the
     constructor docstrings.


In [9]: pdoc??
Type:           Magic function
Base Class:     <type 'instancemethod'>
String Form:    <bound method InteractiveShell.magic_pdoc of  
<IPython.iplib.InteractiveShell instance at 0x26d5a8>>
Namespace:      IPython internal
File:           /Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/IPython/Magic.py
Definition:     pdoc(self, parameter_s='')
Source:
def magic_pdoc(self, parameter_s=''):
         """Print the docstring for an object.

         If the given object is a class, it will print both the class  
and the
         constructor docstrings."""
         self._inspect('pdoc',parameter_s)

In [10]: %pdoc(pdoc)
ERROR: Magic function `pdoc(pdoc)` not found.

In [11]: %psource(pdoc)
ERROR: Magic function `psource(pdoc)` not found.

In [12]:


----------------------------------------------------END  
SESSION----------------------------------------------------



On Jun 20, 2005, at 12:05 PM, Fernando Perez wrote:

> Chanchal G wrote:
>
>> I am having a strange problem. On my machine when I try any of %  
>> pfile, %psource, %pdoc, %pinfo, %page magic functions to view  
>> source  I get
>> "ERROR: Magic function <func call name> not found". I can call  
>> most  of other magic functions and object?, object?? seems to be  
>> working  alright. I can query the documentation of functions  
>> mentioned above  using <func_name>? or <func_name>??
>> I am working on Mac OSX 10.4.1with Python 2.4.1 (MacPython to be   
>> exact) and IPython 0.6.15.
>>
>
> That's extremely bizarre.  I've never seen such an error.
>
> Could you please try:
>
> - remove/rename your ~/.ipython directory so you get a clean  
> reinstall of your configuration, in case it's corrupted.
>
> - post an actual copy/paste log of your work session, in case that  
> shakes my brain in the right direction.
>
> Cheers,
>
> f
>




More information about the IPython-user mailing list