[IPython-user] Re: windows 2000 can't find ipythonrc.ini for anything.

Fernando Perez Fernando.Perez at colorado.edu
Mon Jan 31 02:15:50 CST 2005


Hi,

note that you need to be subscribed (or use gmane) to post to the list.  We 
were getting way too much spam.

I'm replying with CC to the list, in the hopes that other win32 users may be 
of help.

ipython-user-bounces at scipy.net wrote:
> The attached message has been automatically discarded.
> 
> 
> ------------------------------------------------------------------------
> 
> Subject: windows 2000 can't find ipythonrc.ini for anything.
> From: actuary77 <actuary77 at comcast.net>
> Date: Sun, 30 Jan 2005 20:17:02 -0600
> To: ipython-user at scipy.net
> 
> I am using windows 2000.
> 
> My "HOME" dir is c:\home.
> 
> I have set environment variable IPYTHONDIR to c:\home\.ipython
> 
> I have a file "c:\home\.ipython\ipythonrc.ini" with configuration options.
> 
> Color is working.
> 
> Options from the command line work e.g.
> 
>     ipython.py -colors LightBG -pprint   -->>>  gives me color
> 
> However, I can't get IPython to load ini file.  With environment 
> variable set, shouldn't config file load with simply ipython.py form the 
> command line?  (I have .py files set as executible)
> 
> All of these fail to load config:
> 
>    
>     ipython.py  
> 
>     ipython.py -rc "c:\home\.ipython\ipythonrc.ini"
> 
>     OR
> 
>     ipython.py -rc "c:\home\.ipython\ipythonrc.ini"
> 
>     ipython.py -ipythondir "c:/home/.ipython"
> 
>     ipython.oy -ipythondir "c:/home/.ipython" -rc 
> "c:\home\.ipython\ipythonrc.ini"
> 
> or just about any combination does not load config file.
> 
> I can  tell because:
> 
> %config from the IPython shell shows pprint=0, for example and I have 
> pprint = 1.
> 
> There is no confirmation that the config file was found or read.
> 
> %config show IPYTHONDIR: c:\home\.ipython
> 
> 
> What am I doing wrong?????
> 
> D Koch
> actuary77 at comcast.net

I have no idea.  I ran some tests on a WinXP laptop, and it all worked just 
fine.  I even made the same c:\home\.ipython directory and tested the various 
options which you type above, and in my case they all worked correctly (I put 
an 'execute print "hello world"' in the modified .ini file to make sure I was 
really seeing the new one).

The only suggestion I can make is that you put some print statements in 
ipython  itself, to see what's going on specifically on your system.  In 
IPython/ipmaker.py (in your pythonXX/lib/site-packages directory), around line 
429, which loooks like:

         try:
             cfg_loader = ConfigLoader(conflict)
             rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
                                          'include',opts_all.ipythondir,
                                          purge = 1,
                                          unique = conflict['preserve'])

Put a print statement right before the load command:

         try:
             cfg_loader = ConfigLoader(conflict)
             print 'Loading config:',opts_all.rcfile
             rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
                                          'include',opts_all.ipythondir,
                                          purge = 1,
                                          unique = conflict['preserve'])


I'm sorry to say this, but without any way of reproducing the bug myself, I'm 
going to have a hard time helping you out.

One last thing you might try is using a copy of the files without the .ini 
extension.  Under Windows I use .ini, but normally ipython doesn't.  While for 
my tests here everything is working fine with the .ini extension, it's 
possible that something in your setup is confusing ipython, and it may be 
looking for extensionless files.  This is a really long shot, and I doubt it 
will help, but it's easy to test.

Regards,

f




More information about the IPython-user mailing list