You are not logged in.

#1 2013-09-02 19:16:50

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,730
Website

MySQLdb support in python 3 [SOLVED sort of ;)]

I'm working in a python app and I noticed that when I import MySQLdb it gives me the error:

Error loading MySQLdb module: No module named 'MySQLdb'

But if I run python2.7 and import the module all is well and no complaints.

In searching the forums I only found a related bug report from way back (2010) so I wonder if I'm doing something wrong... since I find
difficult to belive that I would be the ONLY one  tongue having the problem if there is in fact no support for MySQLdb in python 3.

Any help would be appreciated.

R.

p.s
I have installed mysql-python, I wonder if I should be running instead the mysql-python-embedded from aur?

Last edited by ralvez (2013-09-05 00:44:38)

Offline

#2 2013-09-03 09:20:28

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: MySQLdb support in python 3 [SOLVED sort of ;)]

https://pypi.python.org/pypi/MySQL-python/1.2.4

MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 will be supported in a future release.

There will not be any future releases, but see https://github.com/farcepest/moist

(this is just what I got from a quick search)

Offline

#3 2013-09-03 09:36:57

progandy
Member
Registered: 2012-05-17
Posts: 5,307

Re: MySQLdb support in python 3 [SOLVED sort of ;)]

If you need mysql with python3, I suggest CyMySQL or the official mysql-connector-python
http://simon04.net/2013/03/python3-mysql/
Since they support the python db api, it should be easy to adapt your code. I gues you'll just have to replace the import.

Last edited by progandy (2013-09-03 09:44:51)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#4 2013-09-05 00:43:43

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,730
Website

Re: MySQLdb support in python 3 [SOLVED sort of ;)]

Thank you both for posting...
I guess I can turn to 2.7 and move on ... I was hoping that by now such basic things as db support would be fully implemented in 3.3
Oh well. smile

Thanks again.

Offline

Board footer

Powered by FluxBB