Discussion:
[sqlalchemy] "No module named pyodbc" for custom Dialect
Lycovian
2015-01-04 05:30:00 UTC
Permalink
I'm attempting to code up a simple Teradata dialect for SQLAlchemy but am
getting a curious error complaining of "No module named pyodbc" when I
attempt to do a create_engine on my Windows box. I'm running on Windows 7
(32-bit), with stock Python 2.7 from the Python website and SQLA 0.9.8 and
pyODBC 3.0.7.

PyODBC otherwise works fine otherwise in other tests from Python, but fails
when SQLAlchemy attempts to __import__ it for some reason. I've found
several posts regarding this issue for IronPython and other non-stock
Windows Pythons but nothing that is glaringly obvious as to what is wrong
with my relatively standard setup.

I'll include the custom dialect files if anyone wants to try it
themselves. The nose tests also appear to fail with this error.

<snip>
*# both libs appear to be local to each other's Python site-packages dir*
In [10]: import sqlalchemy

In [11]: print sqlalchemy.__file__
C:\Python27\lib\site-packages\sqlalchemy\__init__.pyc

In [12]: import pyodbc

In [13]: print pyodbc.__file__
C:\Python27\lib\site-packages\pyodbc.pyd

*# pyodbc appears to work*
In [15]: conn = pyodbc.connect('dsn=td_tms_user')

In [16]: conn.execute('select current_timestamp').fetchone()
Out[16]: (datetime.datetime(2015, 1, 3, 21, 12, 21, 100000), )

*# loading my custom dialect fails though*
In [17]: from sqlalchemy.dialects import registry

In [18]: registry.register("teradata.pyodbc", "sqlalchemy_teradata.pyodbc",
"teradataDialect_pyodbc")

In [19]: engine =
create_engine('teradata+pyodbc://tms_user:***@td_tms_user')
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-19-36d09e5c6713> in <module>()
----> 1 engine =
create_engine('teradata+pyodbc://tms_user:***@td_tms_user')

C:\Python27\lib\site-packages\sqlalchemy\engine\__init__.pyc in
create_engine(*args, **kwargs)
360 strategy = kwargs.pop('strategy', default_strategy)
361 strategy = strategies.strategies[strategy]
--> 362 return strategy.create(*args, **kwargs)
363
364

C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.pyc in
create(self, name_or_url, **kwargs)
49 u = url.make_url(name_or_url)
50
---> 51 dialect_cls = u.get_dialect()
52
53 if kwargs.pop('_coerce_config', False):

C:\Python27\lib\site-packages\sqlalchemy\engine\url.pyc in get_dialect(self)
127 else:
128 name = self.drivername.replace('+', '.')
--> 129 cls = registry.load(name)
130 # check for legacy dialects that
131 # would return a module with 'dialect' as the

C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load(self,
name)
172 def load(self, name):
173 if name in self.impls:
--> 174 return self.impls[name]()
175
176 if self.auto_fn:

C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load()
196 def register(self, name, modulepath, objname):
197 def load():
--> 198 mod = compat.import_(modulepath)
199 for token in modulepath.split(".")[1:]:
200 mod = getattr(mod, token)

C:\Python27\lib\site-packages\sqlalchemy\util\compat.pyc in import_(*args)
138 if len(args) == 4:
139 args = args[0:3] + ([str(arg) for arg in args[3]],)
--> 140 return __import__(*args)
141
142 callable = callable

*ImportError: No module named pyodbc*
</snip>
--
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 sqlalchemy+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Lycovian
2015-01-04 18:32:07 UTC
Permalink
Never mind. I had used the Bitbucket *sqlalchemy-access* as a template and
forgot to include the pyodbc.py file from the example in my code. As it
was named pyodbc.py it confused the issue.

Please disregard question.
Post by Lycovian
I'm attempting to code up a simple Teradata dialect for SQLAlchemy but am
getting a curious error complaining of "No module named pyodbc" when I
attempt to do a create_engine on my Windows box. I'm running on Windows
7 (32-bit), with stock Python 2.7 from the Python website and SQLA 0.9.8
and pyODBC 3.0.7.
PyODBC otherwise works fine otherwise in other tests from Python, but
fails when SQLAlchemy attempts to __import__ it for some reason. I've
found several posts regarding this issue for IronPython and other non-stock
Windows Pythons but nothing that is glaringly obvious as to what is wrong
with my relatively standard setup.
I'll include the custom dialect files if anyone wants to try it
themselves. The nose tests also appear to fail with this error.
<snip>
*# both libs appear to be local to each other's Python site-packages dir*
In [10]: import sqlalchemy
In [11]: print sqlalchemy.__file__
C:\Python27\lib\site-packages\sqlalchemy\__init__.pyc
In [12]: import pyodbc
In [13]: print pyodbc.__file__
C:\Python27\lib\site-packages\pyodbc.pyd
*# pyodbc appears to work*
In [15]: conn = pyodbc.connect('dsn=td_tms_user')
In [16]: conn.execute('select current_timestamp').fetchone()
Out[16]: (datetime.datetime(2015, 1, 3, 21, 12, 21, 100000), )
*# loading my custom dialect fails though*
In [17]: from sqlalchemy.dialects import registry
In [18]: registry.register("teradata.pyodbc",
"sqlalchemy_teradata.pyodbc", "teradataDialect_pyodbc")
In [19]: engine =
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-19-36d09e5c6713> in <module>()
----> 1 engine =
C:\Python27\lib\site-packages\sqlalchemy\engine\__init__.pyc in
create_engine(*args, **kwargs)
360 strategy = kwargs.pop('strategy', default_strategy)
361 strategy = strategies.strategies[strategy]
--> 362 return strategy.create(*args, **kwargs)
363
364
C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.pyc in
create(self, name_or_url, **kwargs)
49 u = url.make_url(name_or_url)
50
---> 51 dialect_cls = u.get_dialect()
52
C:\Python27\lib\site-packages\sqlalchemy\engine\url.pyc in
get_dialect(self)
128 name = self.drivername.replace('+', '.')
--> 129 cls = registry.load(name)
130 # check for legacy dialects that
131 # would return a module with 'dialect' as the
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in
load(self, name)
--> 174 return self.impls[name]()
175
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load()
--> 198 mod = compat.import_(modulepath)
200 mod = getattr(mod, token)
C:\Python27\lib\site-packages\sqlalchemy\util\compat.pyc in import_(*args)
139 args = args[0:3] + ([str(arg) for arg in args[3]],)
--> 140 return __import__(*args)
141
142 callable = callable
*ImportError: No module named pyodbc*
</snip>
--
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 sqlalchemy+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Richard Baxter
2015-06-19 08:01:20 UTC
Permalink
Hi Lycovian

I'm trying to work with Teradata via SQL Alchemy and googling around has
lead mainly to your posts. Were you able to get the two to work together
well? Or did you have to spend a considerable time writing the custom
dialect?

Many thanks, Rich
Post by Lycovian
Never mind. I had used the Bitbucket *sqlalchemy-access* as a template
and forgot to include the pyodbc.py file from the example in my code. As
it was named pyodbc.py it confused the issue.
Please disregard question.
Post by Lycovian
I'm attempting to code up a simple Teradata dialect for SQLAlchemy but am
getting a curious error complaining of "No module named pyodbc" when I
attempt to do a create_engine on my Windows box. I'm running on Windows
7 (32-bit), with stock Python 2.7 from the Python website and SQLA 0.9.8
and pyODBC 3.0.7.
PyODBC otherwise works fine otherwise in other tests from Python, but
fails when SQLAlchemy attempts to __import__ it for some reason. I've
found several posts regarding this issue for IronPython and other non-stock
Windows Pythons but nothing that is glaringly obvious as to what is wrong
with my relatively standard setup.
I'll include the custom dialect files if anyone wants to try it
themselves. The nose tests also appear to fail with this error.
<snip>
*# both libs appear to be local to each other's Python site-packages dir*
In [10]: import sqlalchemy
In [11]: print sqlalchemy.__file__
C:\Python27\lib\site-packages\sqlalchemy\__init__.pyc
In [12]: import pyodbc
In [13]: print pyodbc.__file__
C:\Python27\lib\site-packages\pyodbc.pyd
*# pyodbc appears to work*
In [15]: conn = pyodbc.connect('dsn=td_tms_user')
In [16]: conn.execute('select current_timestamp').fetchone()
Out[16]: (datetime.datetime(2015, 1, 3, 21, 12, 21, 100000), )
*# loading my custom dialect fails though*
In [17]: from sqlalchemy.dialects import registry
In [18]: registry.register("teradata.pyodbc",
"sqlalchemy_teradata.pyodbc", "teradataDialect_pyodbc")
In [19]: engine =
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-19-36d09e5c6713> in <module>()
----> 1 engine =
C:\Python27\lib\site-packages\sqlalchemy\engine\__init__.pyc in
create_engine(*args, **kwargs)
360 strategy = kwargs.pop('strategy', default_strategy)
361 strategy = strategies.strategies[strategy]
--> 362 return strategy.create(*args, **kwargs)
363
364
C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.pyc in
create(self, name_or_url, **kwargs)
49 u = url.make_url(name_or_url)
50
---> 51 dialect_cls = u.get_dialect()
52
C:\Python27\lib\site-packages\sqlalchemy\engine\url.pyc in
get_dialect(self)
128 name = self.drivername.replace('+', '.')
--> 129 cls = registry.load(name)
130 # check for legacy dialects that
131 # would return a module with 'dialect' as the
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in
load(self, name)
--> 174 return self.impls[name]()
175
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load()
--> 198 mod = compat.import_(modulepath)
200 mod = getattr(mod, token)
C:\Python27\lib\site-packages\sqlalchemy\util\compat.pyc in import_(*args)
139 args = args[0:3] + ([str(arg) for arg in args[3]],)
--> 140 return __import__(*args)
141
142 callable = callable
*ImportError: No module named pyodbc*
</snip>
--
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 sqlalchemy+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Mike Wilson
2015-06-19 16:22:17 UTC
Permalink
I had to write a custom dialect to get any sort of functionality. As I eventually got pyodbc to work though I've primarily been using that. I'm working on getting the company I work for off of Teradata so all I really need is connectivity of some sort. Besides that the development for the custom dialect has flagged but out of curiosity I might working on it again soon.

BTW, if you too are trying looking for ways to export data from TD I can't recommend this repo enough:
https://github.com/xlfe/dwhwrapper <https://github.com/xlfe/dwhwrapper>

It's a python exporter that wraps fexp (TD's export utility) and can produce CSV files! I've extended it in a few minor ways for my usage but if I get approval from my company I may fork the original source and post my changes. Definitely worth a look if you are trying to export large amounts of data from TD to non-TD databases.

Cheers.

Mike
Post by Richard Baxter
Hi Lycovian
I'm trying to work with Teradata via SQL Alchemy and googling around has lead mainly to your posts. Were you able to get the two to work together well? Or did you have to spend a considerable time writing the custom dialect?
Many thanks, Rich
Never mind. I had used the Bitbucket sqlalchemy-access as a template and forgot to include the pyodbc.py file from the example in my code. As it was named pyodbc.py it confused the issue.
Please disregard question.
I'm attempting to code up a simple Teradata dialect for SQLAlchemy but am getting a curious error complaining of "No module named pyodbc" when I attempt to do a create_engine on my Windows box. I'm running on Windows 7 (32-bit), with stock Python 2.7 from the Python website and SQLA 0.9.8 and pyODBC 3.0.7.
PyODBC otherwise works fine otherwise in other tests from Python, but fails when SQLAlchemy attempts to __import__ it for some reason. I've found several posts regarding this issue for IronPython and other non-stock Windows Pythons but nothing that is glaringly obvious as to what is wrong with my relatively standard setup.
I'll include the custom dialect files if anyone wants to try it themselves. The nose tests also appear to fail with this error.
<snip>
# both libs appear to be local to each other's Python site-packages dir
In [10]: import sqlalchemy
In [11]: print sqlalchemy.__file__
C:\Python27\lib\site-packages\sqlalchemy\__init__.pyc
In [12]: import pyodbc
In [13]: print pyodbc.__file__
C:\Python27\lib\site-packages\pyodbc.pyd
# pyodbc appears to work
In [15]: conn = pyodbc.connect('dsn=td_tms_user')
In [16]: conn.execute('select current_timestamp').fetchone()
Out[16]: (datetime.datetime(2015, 1, 3, 21, 12, 21, 100000), )
# loading my custom dialect fails though
In [17]: from sqlalchemy.dialects import registry
In [18]: registry.register("teradata.pyodbc", "sqlalchemy_teradata.pyodbc", "teradataDialect_pyodbc")
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-19-36d09e5c6713> in <module>()
C:\Python27\lib\site-packages\sqlalchemy\engine\__init__.pyc in create_engine(*args, **kwargs)
360 strategy = kwargs.pop('strategy', default_strategy)
361 strategy = strategies.strategies[strategy]
--> 362 return strategy.create(*args, **kwargs)
363
364
C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.pyc in create(self, name_or_url, **kwargs)
49 u = url.make_url(name_or_url)
50
---> 51 dialect_cls = u.get_dialect()
52
C:\Python27\lib\site-packages\sqlalchemy\engine\url.pyc in get_dialect(self)
128 name = self.drivername.replace('+', '.')
--> 129 cls = registry.load(name)
130 # check for legacy dialects that
131 # would return a module with 'dialect' as the
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load(self, name)
--> 174 return self.impls[name]()
175
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load()
--> 198 mod = compat.import_(modulepath)
200 mod = getattr(mod, token)
C:\Python27\lib\site-packages\sqlalchemy\util\compat.pyc in import_(*args)
139 args = args[0:3] + ([str(arg) for arg in args[3]],)
--> 140 return __import__(*args)
141
142 callable = callable
ImportError: No module named pyodbc
</snip>
--
You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy/-ONODKBWHXY/unsubscribe <https://groups.google.com/d/topic/sqlalchemy/-ONODKBWHXY/unsubscribe>.
Visit this group at http://groups.google.com/group/sqlalchemy <http://groups.google.com/group/sqlalchemy>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
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 sqlalchemy+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Rich
2015-06-20 20:05:47 UTC
Permalink
Hi Mike

Thanks for the reply. I've broadly just settled on pyodbc too so I feel
reassured to read you've gone this way. I'm quite new to Python so keeping
things simple is probably wise. Unfortunately, my employers have just got
Teradata in - so it's going to be a long time before we see the back of
it...

Thanks for the hat tip on the export repo.

Thanks again, Rich
Post by Mike Wilson
I had to write a custom dialect to get any sort of functionality. As I
eventually got pyodbc to work though I've primarily been using that. I'm
working on getting the company I work for off of Teradata so all I really
need is connectivity of some sort. Besides that the development for the
custom dialect has flagged but out of curiosity I might working on it again
soon.
BTW, if you too are trying looking for ways to export data from TD I can't
https://github.com/xlfe/dwhwrapper
It's a python exporter that wraps fexp (TD's export utility) and can
produce CSV files! I've extended it in a few minor ways for my usage but
if I get approval from my company I may fork the original source and post
my changes. Definitely worth a look if you are trying to export large
amounts of data from TD to non-TD databases.
Cheers.
Mike
Hi Lycovian
I'm trying to work with Teradata via SQL Alchemy and googling around has
lead mainly to your posts. Were you able to get the two to work together
well? Or did you have to spend a considerable time writing the custom
dialect?
Many thanks, Rich
Post by Lycovian
Never mind. I had used the Bitbucket *sqlalchemy-access* as a template
and forgot to include the pyodbc.py file from the example in my code.
As it was named pyodbc.py it confused the issue.
Please disregard question.
Post by Lycovian
I'm attempting to code up a simple Teradata dialect for SQLAlchemy but
am getting a curious error complaining of "No module named pyodbc" when
I attempt to do a create_engine on my Windows box. I'm running on
Windows 7 (32-bit), with stock Python 2.7 from the Python website and SQLA
0.9.8 and pyODBC 3.0.7.
PyODBC otherwise works fine otherwise in other tests from Python, but
fails when SQLAlchemy attempts to __import__ it for some reason. I've
found several posts regarding this issue for IronPython and other non-stock
Windows Pythons but nothing that is glaringly obvious as to what is wrong
with my relatively standard setup.
I'll include the custom dialect files if anyone wants to try it
themselves. The nose tests also appear to fail with this error.
<snip>
*# both libs appear to be local to each other's Python site-packages dir*
In [10]: import sqlalchemy
In [11]: print sqlalchemy.__file__
C:\Python27\lib\site-packages\sqlalchemy\__init__.pyc
In [12]: import pyodbc
In [13]: print pyodbc.__file__
C:\Python27\lib\site-packages\pyodbc.pyd
*# pyodbc appears to work*
In [15]: conn = pyodbc.connect('dsn=td_tms_user')
In [16]: conn.execute('select current_timestamp').fetchone()
Out[16]: (datetime.datetime(2015, 1, 3, 21, 12, 21, 100000), )
*# loading my custom dialect fails though*
In [17]: from sqlalchemy.dialects import registry
In [18]: registry.register("teradata.pyodbc",
"sqlalchemy_teradata.pyodbc", "teradataDialect_pyodbc")
tms_user')
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-19-36d09e5c6713> in <module>()
tms_user')
C:\Python27\lib\site-packages\sqlalchemy\engine\__init__.pyc in
create_engine(*args, **kwargs)
360 strategy = kwargs.pop('strategy', default_strategy)
361 strategy = strategies.strategies[strategy]
--> 362 return strategy.create(*args, **kwargs)
363
364
C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.pyc in
create(self, name_or_url, **kwargs)
49 u = url.make_url(name_or_url)
50
---> 51 dialect_cls = u.get_dialect()
52
C:\Python27\lib\site-packages\sqlalchemy\engine\url.pyc in
get_dialect(self)
128 name = self.drivername.replace('+', '.')
--> 129 cls = registry.load(name)
130 # check for legacy dialects that
131 # would return a module with 'dialect' as the
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load(self, name)
--> 174 return self.impls[name]()
175
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load()
--> 198 mod = compat.import_(modulepath)
200 mod = getattr(mod, token)
C:\Python27\lib\site-packages\sqlalchemy\util\compat.pyc in
import_(*args)
139 args = args[0:3] + ([str(arg) for arg in args[3]],)
--> 140 return __import__(*args)
141
142 callable = callable
*ImportError: No module named pyodbc*
</snip>
--
You received this message because you are subscribed to a topic in the
Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sqlalchemy/-ONODKBWHXY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sqlalchemy/-ONODKBWHXY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
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 sqlalchemy+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Chuanlong Du
2018-01-24 10:36:23 UTC
Permalink
Hi Mike,

Can you share your code of the custom dialect?

Best,
Post by Mike Wilson
I had to write a custom dialect to get any sort of functionality. As I
eventually got pyodbc to work though I've primarily been using that. I'm
working on getting the company I work for off of Teradata so all I really
need is connectivity of some sort. Besides that the development for the
custom dialect has flagged but out of curiosity I might working on it again
soon.
BTW, if you too are trying looking for ways to export data from TD I can't
https://github.com/xlfe/dwhwrapper
It's a python exporter that wraps fexp (TD's export utility) and can
produce CSV files! I've extended it in a few minor ways for my usage but
if I get approval from my company I may fork the original source and post
my changes. Definitely worth a look if you are trying to export large
amounts of data from TD to non-TD databases.
Cheers.
Mike
Hi Lycovian
I'm trying to work with Teradata via SQL Alchemy and googling around has
lead mainly to your posts. Were you able to get the two to work together
well? Or did you have to spend a considerable time writing the custom
dialect?
Many thanks, Rich
Post by Lycovian
Never mind. I had used the Bitbucket *sqlalchemy-access* as a template
and forgot to include the pyodbc.py file from the example in my code.
As it was named pyodbc.py it confused the issue.
Please disregard question.
Post by Lycovian
I'm attempting to code up a simple Teradata dialect for SQLAlchemy but
am getting a curious error complaining of "No module named pyodbc" when
I attempt to do a create_engine on my Windows box. I'm running on
Windows 7 (32-bit), with stock Python 2.7 from the Python website and SQLA
0.9.8 and pyODBC 3.0.7.
PyODBC otherwise works fine otherwise in other tests from Python, but
fails when SQLAlchemy attempts to __import__ it for some reason. I've
found several posts regarding this issue for IronPython and other non-stock
Windows Pythons but nothing that is glaringly obvious as to what is wrong
with my relatively standard setup.
I'll include the custom dialect files if anyone wants to try it
themselves. The nose tests also appear to fail with this error.
<snip>
*# both libs appear to be local to each other's Python site-packages dir*
In [10]: import sqlalchemy
In [11]: print sqlalchemy.__file__
C:\Python27\lib\site-packages\sqlalchemy\__init__.pyc
In [12]: import pyodbc
In [13]: print pyodbc.__file__
C:\Python27\lib\site-packages\pyodbc.pyd
*# pyodbc appears to work*
In [15]: conn = pyodbc.connect('dsn=td_tms_user')
In [16]: conn.execute('select current_timestamp').fetchone()
Out[16]: (datetime.datetime(2015, 1, 3, 21, 12, 21, 100000), )
*# loading my custom dialect fails though*
In [17]: from sqlalchemy.dialects import registry
In [18]: registry.register("teradata.pyodbc",
"sqlalchemy_teradata.pyodbc", "teradataDialect_pyodbc")
tms_user')
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-19-36d09e5c6713> in <module>()
tms_user')
C:\Python27\lib\site-packages\sqlalchemy\engine\__init__.pyc in
create_engine(*args, **kwargs)
360 strategy = kwargs.pop('strategy', default_strategy)
361 strategy = strategies.strategies[strategy]
--> 362 return strategy.create(*args, **kwargs)
363
364
C:\Python27\lib\site-packages\sqlalchemy\engine\strategies.pyc in
create(self, name_or_url, **kwargs)
49 u = url.make_url(name_or_url)
50
---> 51 dialect_cls = u.get_dialect()
52
C:\Python27\lib\site-packages\sqlalchemy\engine\url.pyc in
get_dialect(self)
128 name = self.drivername.replace('+', '.')
--> 129 cls = registry.load(name)
130 # check for legacy dialects that
131 # would return a module with 'dialect' as the
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load(self, name)
--> 174 return self.impls[name]()
175
C:\Python27\lib\site-packages\sqlalchemy\util\langhelpers.pyc in load()
--> 198 mod = compat.import_(modulepath)
200 mod = getattr(mod, token)
C:\Python27\lib\site-packages\sqlalchemy\util\compat.pyc in
import_(*args)
139 args = args[0:3] + ([str(arg) for arg in args[3]],)
--> 140 return __import__(*args)
141
142 callable = callable
*ImportError: No module named pyodbc*
</snip>
--
You received this message because you are subscribed to a topic in the
Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/sqlalchemy/-ONODKBWHXY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
<javascript:>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
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 sqlalchemy+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Loading...