Eduardo wrote: > > /.../.../python2.6/site-packages/SQLAlchemy-0.6.5- > py2.6.egg/sqlalchemy/ > dialects/postgresql/psycopg2.py", line 234, in dbapi > psycopg = __import__('psycopg2') > ImportError: No module named psycopg2 > > The module psycopg2 is already installed in the site-packages > directory. I even included the path in the system variable by : > sys.path.append('/.../.../python2.6/site-packages/') in the wsgi > script.Still it won't work. > Why? >
OK, this is definitely no longer an SQLAlchemy issue and more of a mod_wsgi issue - you might get more help over on their mailing list (http://code.google.com/p/modwsgi/wiki/WhereToGetHelp). I believe psycopg2 is not a pure python module - it has a binary component. Was it compiled with the same version of python that mod_wsgi was? Try this wsgi script (based on one from http://code.google.com/p/modwsgi/wiki/InstallationIssues) import sys from pprint import pformat def application(environ, start_response): status = '200 OK' output = ("sys.prefix: %r\nsys.path: %s\n" % (sys.prefix, pformat(sys.path)) response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] It would be worth comparing the output from that with the values of sys.prefix and sys.path when run from bottle. Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.