How To Install Mysqldb With Python 3.2
Solution 1:
Please note that you have to have curl
installed. You can grab it from here.
Assuming python.exe
command starts python3 on your machine.
Steps:
- Download
distribute_setup.py
frompython-distribute.org/distribute_setup.py
to upgrade setuptools. Execute the following command to upgrade setuptools for your local python3:
python.exe distribute_setup.py
Download and install the
pymysql
driver:curl -L https://github.com/PyMySQL/PyMySQL/tarball/pymysql-0.6 | tar xz cd PyMySQL-PyMySQL-7c86923/ sudo python3 setup.py install
Download and install MySQLdb driver for python3
git clone https://github.com/davispuh/MySQL-for-Python-3.git cd MySQL-for-Python-3/ python3 setup.py install
To check open python interpreter via
python.exe
command and execute:import pymysql import MySQLdb
If everything went ok - then both lines should not fail.
Solution 2:
I couldn't get MySQLdb to work with Python 3 either, so I installed the MySQL/Connector module. It's been workin' like a charm & it was a simple install. I was a complete Python newbie at the time, so unless I'm a genius then it's pretty easy to install for anyone.
Solution 3:
After further googling I don't think that using mysqldb or whatever is the best solution. I found this page: http://wiki.python.org/moin/MySQL I decided to give the mysql connector/python a try. It seems pretty straightforward with no crazy installs.
Post a Comment for "How To Install Mysqldb With Python 3.2"