-
Notifications
You must be signed in to change notification settings - Fork 44
Install on Linux
davispuh edited this page Aug 13, 2012
·
6 revisions
- Python 3 and headers (packages: python3 and python3-dev)
- distribute
-
mysql_configutility along with MySQL headers (libmysqlclient-dev package) - compiler and linker
- MySQL for Python 3 tarball
(MySQL server nor client aren't required, in case your MySQL server are on another machine)
- Install Python 3 and also Python 3 headers
sudo apt-get install python3 python3-dev - check if
python3works - download and install distribute.
easiest way
wget http://python-distribute.org/distribute_setup.pythenpython3 distribute_setup.py - install libmysqlclient-dev package and it's dependencies. which will contain
mysql_configand MySQL headers. Also as dependencies gcc will be installed.sudo apt-get install libmysqlclient-dev - download MySQL for Python 3 tarball
- extract it
- and now finally install it with
python3 setup.py install - can test if it was successfully installed by opening python3 and
import MySQLdb
- install MySQL server
sudo apt-get install mysql-server - create
test.pywith contents from [Usage example](Usage example) - edit settings (root password, etc) accordingly
- try it with
python3 test.py
apt-get is for Debian, Ubuntu distributions, if you've Fedora or CentOS then use yum. Different for others.