I have no idea what I'm doing wrong, but I can't get sqlalchemy working 
with MySQL and PyMySQL driver. The driver works with my db. But SQLAlchemy 
blows with traceback. Any hints, please?

Here is testing script:

#!/usr/bin/python3

import sys
print('sys.version: %s' % sys.version)

import pymysql
print('pymysql version: %s' % repr(pymysql.VERSION))

conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', 
passwd='root', database='mydb')
cur = conn.cursor()
cur.execute("SELECT * FROM users")
for row in cur:
   print(row)
cur.close()
conn.close()

import sqlalchemy
print('sqlalchemy version: %s' % sqlalchemy.__version__)

engine = 
sqlalchemy.create_engine('mysql+pymysql://root:root@127.0.0.1:3306/mydb')
engine.connect()
#--------------------------------------------------------------

And here is what I got:

sys.version: 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 
32 bit (Intel)]

pymysql version: (0, 6, 1, None)
(1, 'al...@wonderland.com', 1)

sqlalchemy version: 0.9.2
Traceback (most recent call last):
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 913, in _do_get
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\util\queue.py",
 
line 158, in get
    available, else raise the Empty exception ('timeout' is ignored
sqlalchemy.util.queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\work\db-wrapper\alchemy\test-connect.py", line 21, in <module>
    engine.connect()
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\engine\base.py",
 
line 1678, in connect
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\engine\base.py",
 
line 59, in __init__
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\engine\base.py",
 
line 1747, in raw_connection
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 272, in unique_connection
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 608, in _checkout
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 425, in checkout
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 928, in _do_get
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 277, in _create_connection
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\pool.py", 
line 401, in __init__
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\event\attr.py",
 
line 238, in exec_once
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\event\attr.py",
 
line 247, in __call__
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\util\langhelpers.py",
 
line 1180, in go
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\engine\strategies.py",
 
line 166, in first_connect
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\dialects\mysql\base.py",
 
line 2199, in initialize
  File 
"C:\Python33\lib\site-packages\sqlalchemy-0.9.2-py3.3.egg\sqlalchemy\connectors\mysqldb.py",
 
line 133, in _detect_charset
TypeError: unorderable types: NoneType() < tuple()
[Finished in 1.2s with exit code 1]

Alexander

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to