[IPython-user] Solved? Re: Slight Problem: Re: Test results (good?)

Jörgen Stenarson jorgen.stenarson@bostream...
Tue May 1 07:00:45 CDT 2007


I don't think it is possible to have both at this time. Because 
rlcompleter in stdlib imports readline explictly (I believe this has 
changed in 2.5). This dependency forced us to create readline.py in 
site-packages when installing pyreadline. Eventually when 
ipython/pyreadline requires 2.5 or higher we should be able to have a 
choice of different readline implementations.

/Jörgen

Ryan Krauss skrev:
> So, I had readline and pyreadline both installed.  I deleted the
> readline directory from site-packages and everything seems to be cool.
> I don't know why I had both.  I can't think of ever intentionally
> installing either except as a dependancy for IPython (unless they both
> come with Enthought-Python).  Is this the right solution?  Should I
> need both?  Should I be able to have both and set some rc setting to
> tell IPython which to use?
> 
> Thanks,
> 
> Ryan
> 
> On 4/30/07, Ryan Krauss <ryanlists@gmail.com> wrote:
>> Thanks Jörgen, we may be making some progress.
>>
>> I can execute
>>  import pyreadline
>> pyreadline.clear_history
>>
>> without error, but the error I am getting everytime I run anything is
>>
>> -> 1259             self.readline.clear_history()
>>    1260             self.readline.read_history_file(self.shell.histfile)
>>    1261
>>
>> AttributeError: 'module' object has no attribute 'clear_history'
>>
>> So it seems like the readline being used here is not pyreadline 1.4
>> rc1.  I added a Pdb().set_race() and got this additional info:
>>
>> ipdb> self.readline
>> Out[2]: <module 'IPython.rlineimpl' from 
>> 'C:\Python24\lib\site-packages\IPython\
>> rlineimpl.pyc'>
>>
>> What does that mean?  Should I have a readline setting somewhere (in
>> some rc files?) that makes this object:
>> ipdb> self
>> Out[3]: <IPython.Shell.MatplotlibMTShell object at 0x0134D0F0>
>>
>> pick up the right readline module?
>>
>> Ryan
>>
>> On 4/30/07, Jörgen Stenarson <jorgen.stenarson@bostream.nu> wrote:
>> > Ryan,
>> >
>> > I have been unable to reproduce your problems with python 2.4 and an
>> > install of pyreadline-1.4.3.rc1.win32.exe.
>> > what is the minimum script that produces the traceback when using %run
>> > from ipython?
>> >
>> > At the ipython and python prompt, can you do
>> > import pyreadline
>> > pyreadline.clear_history
>> > without error?
>> >
>> > /Jörgen
>> >
>> >
>> > Ryan Krauss skrev:
>> > > I deleted the pyreadline dir in site-packages:
>> > >
>> > > In [1]: import pyreadline
>> > > 
>> --------------------------------------------------------------------------- 
>>
>> > > exceptions.ImportError                               Traceback 
>> (most recent call
>> > >  last)
>> > >
>> > > C:\Documents and Settings\Ryan\<ipython console>
>> > >
>> > > ImportError: No module named pyreadline
>> > >
>> > >
>> > > and then reinstalled from pyreadline-1.4.3.rc1.win32.exe
>> > >
>> > > The package is coming from here:
>> > >
>> > > In [2]: reload(pyreadline)
>> > > Out[2]: <module 'pyreadline' from 
>> 'c:\python24\lib\site-packages\pyreadline\__in
>> > > it__.pyc'>
>> > >
>> > > and I still have the problem.
>> > >
>> > > Ryan
>> > > On 4/26/07, Fernando Perez <fperez.net@gmail.com> wrote:
>> > >> On 4/26/07, Ryan Krauss <ryanlists@gmail.com> wrote:
>> > >>> No change, I installed last night, so I think it is the same 
>> (the exe
>> > >>> had the same name).
>> > >> Long shot: any chance you may be picking an old/outdated 
>> pyreadline by
>> > >> accident?  The error reported by your traceback:
>> > >>
>> > >>>>> C:\Python24\Lib\site-packages\IPython\iplib.py in 
>> reloadhist(self)
>> > >>>>>    1255
>> > >>>>>    1256         if self.has_readline:
>> > >>>>> -> 1257             self.readline.clear_history()
>> > >>>>>    1258             
>> self.readline.read_history_file(self.shell.histfile)
>> > >>>>>    1259
>> > >>>>>
>> > >>>>> AttributeError: 'module' object has no attribute 'clear_history'
>> > >> was positively fixed here:
>> > >>
>> > >> http://projects.scipy.org/ipython/ipython/changeset/2238
>> > >>
>> > >> [ I just noticed the patch appears from John Hunter, I was 
>> testing his
>> > >> account and ended up with his username in the commit :) ]
>> > >>
>> > >> So it's really, really strange that you are seeing this 
>> particular error.
>> > >>
>> > >> If it's not this, I'm officially out of ideas, given how this is all
>> > >> win32/readline.  Any of our gurus in the room ?
>> > >>
>> > >> Cheers,
>> > >>
>> > >> f
>> > >>
>> > > _______________________________________________
>> > > IPython-user mailing list
>> > > IPython-user@scipy.org
>> > > http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
>> > >
>> >
>> >
>>
> 



More information about the IPython-user mailing list