On Dec 13, 2007 11:24 AM, Ed Singleton <[EMAIL PROTECTED]> wrote:
>
> I'm having problems with the tutorial when using ipython (but not when
> using the normal python interpreter).  I'm using python2.4 on Mac OS X
> 10.4, with elixir 0.5, and ipython 0.8.2

I know this isn't of much help, but here it works fine on Ubuntu Gutsy
which ships ipython 0.8.1. Tried with both python 2.4 and python 2.5.

> With a model that contains:
>
> ######
> from elixir import *
>
> metadata.bind = "sqlite:///movies.sqlite"
> metadata.bind.echo = True
>
> class Movie(Entity):
>     title = Field(Unicode(30))
>     year = Field(Integer)
>     description = Field(Unicode)
>
>     def __repr__(self):
>         return '<Movie "%s" (%d)>' % (self.title, self.year)
> ######
>
> I go to ipython and get:
>
> In [1]: from model import *
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /Users/ed/tg-sites/picard/<ipython console>
>
> /Users/ed/tg-sites/picard/model.py
>       2
>       3 metadata.bind = "sqlite:///movies.sqlite"
> ----> 4 metadata.bind.echo = True
>       5
>       6 class Movie(Entity):
>
> AttributeError: 'str' object has no attribute 'echo'

Hmmm, if it weren't for the fact that it works in normal python, I'd
say it's because you are using an old version of SQLAlchemy. That
syntax requires SQLAlchemy 0.3.9, I think (or possibly 0.3.10). Would
it be possible that when run through ipython, your PYTHONPATH points
to another SQLAlchemy?

> If I comment out the line:
> # metadata.bind.echo = True
>
> and then go back to ipython, I get:
>
> In [1]: from model import *
>
> In [2]: setup_all()
> ERROR: Internal Python error in the inspect module.
> Below is the traceback from this internal error.
>
> Traceback (most recent call last):
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ipython-0.8.2-py2.4.egg/IPython/ultraTB.py",
> line 576, in text
>     records = _fixed_getinnerframes(etb, context,self.tb_offset)
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ipython-0.8.2-py2.4.egg/IPython/ultraTB.py",
> line 203, in _fixed_getinnerframes
>     records  = inspect.getinnerframes(etb, context)
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/inspect.py",
> line 811, in getinnerframes
>     framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/inspect.py",
> line 775, in getframeinfo
>     lines, lnum = findsource(frame)
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/inspect.py",
> line 437, in findsource
>     if pat.match(lines[lnum]): break
> IndexError: list index out of range
>
> Unfortunately, your original traceback can not be constructed.

Even stranger. Sorry, I have no idea what happens here.

-- 
Gaƫtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to