Re: [Project Camelot] Camelot won't work on Ubuntu 12.04

91 views
Skip to first unread message

Erik Janssens

unread,
Jan 30, 2013, 2:44:42 AM1/30/13
to project...@googlegroups.com
Hello,

try to downgrade your SQLA version to 0.7.x, as the current release
is only tested with the 0.7 series.

there are always small changes between SQLA releases which make
some things not work properly

Regards,

Erik

On Wed, Jan 30, 2013 at 8:09 AM, Niclas Nilsson <niclas.k...@gmail.com> wrote:

I'm trying to install and run the framework Camelot on Ubuntu 12.04. I've installed camelot with:

"pip install camelot" and it installed without any problems. I've tried to upgrade both sqlalchemy and camelot but it throws an exception and won't work when I run:

"python -m camelot.bin.camelot_admin"


Some versions:

In [1]: import camelot

In [2]: camelot.__version__
Out[2]: '12.06.29'

In [3]: import sqlalchemy

In [4]: sqlalchemy.__version__
Out[4]: '0.8.0b2'



This is the traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 263, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 255, in main
    meta()
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 243, in meta
    from camelot.bin.meta import launch_meta_camelot
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/meta.py", line 34, in <module>
    from camelot.admin.application_admin import ApplicationAdmin
  File "/usr/local/lib/python2.7/dist-packages/camelot/admin/application_admin.py", line 34, in <module>
    from camelot.admin.action import application_action, form_action, list_action
  File "/usr/local/lib/python2.7/dist-packages/camelot/admin/action/__init__.py", line 25, in <module>
    from application_action import ( ApplicationActionGuiContext,
  File "/usr/local/lib/python2.7/dist-packages/camelot/admin/action/application_action.py", line 31, in <module>
    from camelot.core.orm import Session
  File "/usr/local/lib/python2.7/dist-packages/camelot/core/orm.py", line 48, in <module>
    from sqlalchemy.ext.declarative import ( declarative_base,
ImportError: cannot import name _declarative_constructor

--
--
You received this message because you are subscribed to the "Project Camelot" group.
Visit www.python-camelot.com for more information
 
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to
project-camel...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/project-camelot?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Project Camelot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-camel...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Niclas Nilsson

unread,
Jan 30, 2013, 3:15:45 AM1/30/13
to project...@googlegroups.com
I downgraded sqlalchemy to 0.7.9. Now it instead says:

nine@nine-laptop:~/slask$ python -m camelot.bin.camelot_admin

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 263, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 255, in main
    meta()
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 243, in meta
    from camelot.bin.meta import launch_meta_camelot
  File "/usr/local/lib/python2.7/dist-packages/camelot/bin/meta.py", line 34, in <module>
    from camelot.admin.application_admin import ApplicationAdmin
  File "/usr/local/lib/python2.7/dist-packages/camelot/admin/application_admin.py", line 34, in <module>
    from camelot.admin.action import application_action, form_action, list_action
  File "/usr/local/lib/python2.7/dist-packages/camelot/admin/action/__init__.py", line 25, in <module>
    from application_action import ( ApplicationActionGuiContext,
  File "/usr/local/lib/python2.7/dist-packages/camelot/admin/action/application_action.py", line 31, in <module>
    from camelot.core.orm import Session
  File "/usr/local/lib/python2.7/dist-packages/camelot/core/orm.py", line 48, in <module>
    from sqlalchemy.ext.declarative import ( declarative_base,
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/__init__.py", line 1254, in <module>
    from .api import declarative_base, synonym_for, comparable_using, \
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/api.py", line 103, in <module>
    class declared_attr(interfaces._MappedAttribute, property):
AttributeError: 'module' object has no attribute '_MappedAttribute'

Erik Janssens

unread,
Jan 30, 2013, 3:21:04 AM1/30/13
to project...@googlegroups.com
hmm, that's odd, now it fails inside a simple SQLA import

maybe try to downgrade 0.7.8, this was the last version available at the release if I
remember well

I'm running the master branch against 0.7.9 and this works fine

can you just do in the interpreter :

from sqlalchemy.ext.declarative import *

??


--

Niclas Nilsson

unread,
Jan 30, 2013, 3:31:32 AM1/30/13
to project...@googlegroups.com, erik.j...@conceptive.be
It is indeed. If I try running "from sqlalchemy.ext.declarative import *"

I get:

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'


This is both with 0.7.9 and 0.7.8.

Erik Janssens

unread,
Jan 30, 2013, 3:37:15 AM1/30/13
to project...@googlegroups.com
that's odd, I suspect something is wrong with your SQLA setup, that needs to
be corrected first.

maybe try to remove all versions of it completely and then do a reinstall

also start your interpreter in a 'clean' directory, to make sure the files that
are imported are the correct ones, eg there is no 'interfaces.py' file somewhere
which takes the place of the one in sqla

Niclas Nilsson

unread,
Jan 30, 2013, 4:22:13 AM1/30/13
to project...@googlegroups.com, erik.j...@conceptive.be
It won't work. This is what I did:

nine@nine-laptop:~/slask$ sudo pip uninstall sqlalchemy
Uninstalling SQLAlchemy:
Proceed (y/n)? y
  Successfully uninstalled SQLAlchemy
nine@nine-laptop:~/slask$ sudo pip install -U sqlalchemy==0.7.8
Downloading/unpacking sqlalchemy==0.7.8
  Downloading SQLAlchemy-0.7.8.tar.gz (2.6Mb): 2.6Mb downloaded
  Running setup.py egg_info for package sqlalchemy
   
    warning: no files found matching '*.jpg' under directory 'doc'
    no previously-included directories found matching 'doc/build/output'
Installing collected packages: sqlalchemy
  Found existing installation: SQLAlchemy 0.8.0b2
    Uninstalling SQLAlchemy:
      Successfully uninstalled SQLAlchemy
  Running setup.py install for sqlalchemy
    building 'sqlalchemy.cprocessors' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c lib/sqlalchemy/cextension/processors.c -o build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/processors.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/processors.o -o build/lib.linux-x86_64-2.7/sqlalchemy/cprocessors.so
    building 'sqlalchemy.cresultproxy' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c lib/sqlalchemy/cextension/resultproxy.c -o build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/resultproxy.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/resultproxy.o -o build/lib.linux-x86_64-2.7/sqlalchemy/cresultproxy.so
   
    warning: no files found matching '*.jpg' under directory 'doc'
    no previously-included directories found matching 'doc/build/output'
Successfully installed sqlalchemy
Cleaning up...
nine@nine-laptop:~/slask$ rm -fr *
nine@nine-laptop:~/slask$ ipython
Python 2.7.3 (default, Aug  1 2012, 05:14:39)
Type "copyright", "credits" or "license" for more information.

IPython 0.12.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

Erik Janssens

unread,
Jan 30, 2013, 4:32:25 AM1/30/13
to project...@googlegroups.com
the same set of actions do work on my side

what you can do is remove SQLA by hand from
/usr/local/lib/python2.7/dist-packages/
to make sure it's really gone

you can also do on the prompt :

import sqlalchemy
print sqlalchemy.__file__

to see if it picks up the right file, and
then move further down the import process to
see what exactly is happening

if that doesn't work, maybe ask on the SQLA
mailing list

tw55413@alberobello:~$ sudo pip install -U sqlalchemy==0.7.8

Downloading/unpacking sqlalchemy==0.7.8
  Downloading SQLAlchemy-0.7.8.tar.gz (2.6Mb): 2.6Mb downloaded
  Running setup.py egg_info for package sqlalchemy
   
    warning: no files found matching '*.jpg' under directory 'doc'
    no previously-included directories found matching 'doc/build/output'
Installing collected packages: sqlalchemy
  Found existing installation: SQLAlchemy 0.7.9

    Uninstalling SQLAlchemy:
      Successfully uninstalled SQLAlchemy
  Running setup.py install for sqlalchemy
    building 'sqlalchemy.cprocessors' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c lib/sqlalchemy/cextension/processors.c -o build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/processors.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/processors.o -o build/lib.linux-x86_64-2.7/sqlalchemy/cprocessors.so
    building 'sqlalchemy.cresultproxy' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c lib/sqlalchemy/cextension/resultproxy.c -o build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/resultproxy.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/lib/sqlalchemy/cextension/resultproxy.o -o build/lib.linux-x86_64-2.7/sqlalchemy/cresultproxy.so
   
    warning: no files found matching '*.jpg' under directory 'doc'
    no previously-included directories found matching 'doc/build/output'
Successfully installed sqlalchemy
Cleaning up...
tw55413@alberobello:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from sqlalchemy.ext.declarative import *
>>>


Niclas Nilsson

unread,
Jan 30, 2013, 4:38:46 AM1/30/13
to project...@googlegroups.com
I uninstalled sqla with, deleted the remaining files manually, reinstalled it and now it works. I should have thought of that myself. Thanks alot! :-)

Niclas Nilsson

unread,
Jan 30, 2013, 4:43:29 AM1/30/13
to project...@googlegroups.com
I don't know if you like credits on StackOverflow (or if you use it). But if you do, you can pretty much copy-and-paste my update on http://stackoverflow.com/questions/14600530/cant-import-from-sqlalchemy-ext-declarative and I will make it the accepted answer. If you want, that is.
Reply all
Reply to author
Forward
0 new messages