python - Error when trying to use pymysql with sqlalchemy sre_constants.error: nothing to repeat -


I tried to use pymsql with sqlalchemy using this code:

 sqlalchemy import from create_engine engine = Create_engine ("mysql + pymsql: // root: @ localhost / pydb") conn = engine.connect () 

And this exception has been picked up here: Full stack trace:

 Traceback (most recent call final): File "C: \ Python33 \ lib \ site-packages \" file: "D: \ Parser \ dal__init __. Py", line 3, engine = create_engine ("mysql + pymsql : // root: @ localhost / pydb "Sqlalchemy-0.9.2-py3.3.egg \ sqlalchemy \ engine__init __. Py", line 344, in the create_engine file "C: \ Python33 \ lib \ site-packages \ sqlalchemy- 0.9 .2-py3.3.egg \ sqlalchemy \ engine \ strategies ", line 48," C: \ Python 33 \ lib \ site-packages \ sqlalchemy-0.9.2-py3.3.egg \ sqlalchemy \ engine " \ Url.py ", line 163," C: \ Python33 \ lib \ site-packages \ sqlalchemy-0.9.2-py3.3.egg \ sqlalchemy \ engine \ url.py "in the Make_url file, in line 183, _parse_rfc1738_ar GS file "C: \ Python 33 \ lib \ re.py", line 214, back in the compiling _compile (pattern, flags) file "C: \ Python33 \ lib \ re.py", in line 281, _compile p = sre_compile . File "C: \ Python 33 \ lib \ sre_compile.py", line 483, file compilation (pattern, flags) file "C: \ Python33 \ lib \ sre_compile.py", line 498, compilation code = _code (p, flags) ) In the file "C: \ Python33 \ lib \ sre_compile.py", line 75, _compile elif _simple (av) and op is not resized: in the file "c: \ Python33 \" in the file _code _compile (code, p.data, flags) Lib \ Sre_compile.py ", in line 362, _simple enhancement error (" nothing to repeat ") sre_constants.error: 

After your username, drop : from your connection string Instead mysql + pymsql: // root @ should be localhost / pydb


Comments