Hello,

I've got a very peculiar situation, where SQLA fails to create an engine, 
because it can't find the installed module, only when I do some relatively 
straightforward package discovery & import logic using imp.find_module and 
imp.load_module.

I'm wondering if SQLAlchemy does some magic which might be impacted if I've 
used find_module and load_module upstream, despite being in different name 
spaces(?)

I'm working with Python 2.7.6, SQLAlchemy 0.9.2, and Postgres 9.4, and 
psycopg2

Here's the traceback...

Traceback (most recent call last):
  File "C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\pdb.py", line 
1314,
 in main
    pdb._runscript(mainpyfile)
  File "C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\pdb.py", line 
1233,
 in _runscript
    self.run(statement)
  File "C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\bdb.py", line 
400,
in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "install.py", line 2, in <module>
    from equitable.db.psyw import DBpicker, SQLAeng, SmartDB
  File 
"C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\site-packages\trump
\orm.py", line 2287, in SetupTrump
    engine = create_engine(engine_str)
  File 
"C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\site-packages\sqlal
chemy\engine\__init__.py", line 344, in create_engine
    return strategy.create(*args, **kwargs)
  File 
"C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\site-packages\sqlal
chemy\engine\strategies.py", line 50, in create
    dialect_cls = u.get_dialect()
  File 
"C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\site-packages\sqlal
chemy\engine\url.py", line 116, in get_dialect
    cls = registry.load(name)
  File 
"C:\WinPython-32bit-2.7.6.3-20140407\python-2.7.6\lib\site-packages\sqlal
chemy\util\langhelpers.py", line 186, in load
    (self.group, name))
NoSuchModuleError: Can't load plugin: 
sqlalchemy.dialects:postgresql.psycopg2


SQLAlchemy works as expected, (ie, it finds psycopg2) if I comment out line 
60 of https://github.com/Equitable/trump/blob/master/trump/orm.py (and 
replace the variable "sources" with an empty dictionary).  Line 60, is an 
import to sub-module which dynamically loads modules.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to