Hi Galaxy Developers

I aim to write a tool that will interact with Postgres database; here is what I 
wrote to test database connectivity. This script resides in 
/galaxy-dist/tools/test_tool/ and gets invoked from the front end. However 
script generate following error: No module named psycopg2.

Here is my code:
#!/usr/bin/env python

import os.path
import os
from galaxy import eggs
from galaxy.model import *
from sqlalchemy import *

engine = create_engine('postgresql://postgres:@')
connection = engine.connect()
result_set = connection.execute( "select id from galaxy_user" )
for row in result_set:
                print row[ 'id' ]

Traceback (most recent call last):
  File "/galaxy-dist/tools/overlapanalysis/db_test.py", line 10, in ?
    engine = create_engine('postgresql://postgres:@')
 line 223, in create_engine
    return strategy.create(*args, **kwargs)
 line 62, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
 line 368, in dbapi
    import psycopg2 as psycopg
ImportError: No module named psycopg2

Thanks for any help.

Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:


Reply via email to