ipython
is an interactive shell built with python. It has amazing set of features and once you get used to it, you simply can't live without it!Recently, some how my ipython configuration got corrupt and I was always greeted with the following message when I start an ipython shell:
psj@psj-desktop:~/Downloads/$ /usr/bin/ipython2.6 WARNING: Configuration file ipythonrc not found. Ignoring request.
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/IPython/ConfigLoader.py", line 66, in load
fname = filefind(fname,incpath)
File "/usr/lib/pymodules/python2.6/IPython/genutils.py", line 555, in filefind
' not found in current or supplied directories:' + `alt_dirs`
IOError: File'ipythonrc' not found in current or supplied directories:u'/home/psj/.ipython'
WARNING: Problems loading configuration file 'ipythonrc'
Starting with default -bare bones- configuration.
Python 2.6.5 (r265:79063, Feb 27 2014, 19:44:14)
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
I tried to uninstall and install ipython module using:
$ sudo pip uninstall ipython
$ sudo pip install ipython
But, it was not of any help. I was still not able to use the amazing features of ipython. Then, I tried to locate existing 'ipythonrc' file on my system and volla! - I could find the file under /usr/share directory!
root@psj-desktop:~# locate ipythonrc
/home/psj/.ipython/ipythonrc-math
/home/psj/.ipython/ipythonrc-numeric
/home/psj/.ipython/ipythonrc-physics
/home/psj/.ipython/ipythonrc-pysh
/home/psj/.ipython/ipythonrc-tutorial
/usr/lib/pymodules/python2.6/IPython/UserConfig/ipythonrc
/usr/lib/pymodules/python2.6/IPython/UserConfig/ipythonrc-math
/usr/lib/pymodules/python2.6/IPython/UserConfig/ipythonrc-numeric
/usr/lib/pymodules/python2.6/IPython/UserConfig/ipythonrc-physics
/usr/lib/pymodules/python2.6/IPython/UserConfig/ipythonrc-pysh
/usr/lib/pymodules/python2.6/IPython/UserConfig/ipythonrc-tutorial
/usr/share/pyshared/IPython/UserConfig/ipythonrc
/usr/share/pyshared/IPython/UserConfig/ipythonrc-math
/usr/share/pyshared/IPython/UserConfig/ipythonrc-numeric
/usr/share/pyshared/IPython/UserConfig/ipythonrc-physics
/usr/share/pyshared/IPython/UserConfig/ipythonrc-pysh
/usr/share/pyshared/IPython/UserConfig/ipythonrc-tutorial
After seeing that 'ipythonrc' is missing in my home directory, I copied it to my home directory.
root@psj-desktop:~# cp /usr/share/pyshared/IPython/UserConfig/ipythonrc /home/psj/.ipython/
And everything works nicely as usual..
psj@psj-desktop:~$ sudo ln -s /usr/bin/ipython2.6 /usr/bin/ipython
psj@psj-desktop:~$ ipython
Python 2.6.5 (r265:79063, Feb 27 2014, 19:44:14)
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: import os
In [2]: os.
Display all 234 possibilities? (y or n)
No comments:
Post a Comment