If I try to execute from sqlalchemy.ext.declarative import * it fails. I’ve tried do uninstall package with pip uninstall sqlalchemy and reinstall it again. I’ve tried removed the version from the Ubuntu repositary (the python-sqlalchemy-package) but it wasn’t installed. I’ve got to a clean directory and tried the same command. Still don’t work. This is both with sqlalchemy 0.7.8 and 0.7.9.
This is the traceback:
In [1]: from sqlalchemy.ext.declarative import *
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/home/nine/slask/<ipython-input-1-7f210e4ec48b> in <module>()
----> 1 from sqlalchemy.ext.declarative import *
/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/__init__.py in <module>()
1252 """
1253
-> 1254 from .api import declarative_base, synonym_for, comparable_using, \
1255 instrument_declarative, ConcreteBase, AbstractConcreteBase, \
1256 DeclarativeMeta, DeferredReflection, has_inherited_table,\
/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/api.py in <module>()
101
102
--> 103 class declared_attr(interfaces._MappedAttribute, property):
104 """Mark a class-level method as representing the definition of
105 a mapped property or special declarative member name.
AttributeError: 'module' object has no attribute '_MappedAttribute'
For the record, I’m running Ubuntu 12.04.
Now it works. This is what i did:
rm -fr /usr/local/lib/python2.7/dist-packages/sqlalchemy)