login community faq
0
1

I need to access a MySQL database from a Python 3 application, but MySQLdb isn't available for Python 3 yet. The PyMySQL module seems to work with Python 3, so how can I install it in my WebFaction home directory?

asked Oct 02 '12 at 16:50

seanf's gravatar image

seanf ♦♦
56291220

edited Oct 02 '12 at 16:52


You can install PyMySQL for Python 3.2 in your WebFaction home directory with the following commands:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mkdir -p ~/bin ~/tmp ~/lib/python3.2 ~/src
export TMPDIR=~/tmp
wget -O ~/bin/2to3 http://hg.python.org/cpython/raw-file/60c831305e73/Tools/scripts/2to3
chmod 700 ~/bin/2to3
cd ~/src
git clone https://github.com/petehunt/PyMySQL.git
cd PyMySQL/
./build-py3k.sh
cd py3k/
python3.2 setup.py install --install-lib=$HOME/lib/python3.2 --install-scripts=$HOME/bin

answered Oct 02 '12 at 16:51

seanf's gravatar image

seanf ♦♦
56291220

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×116
×6
×1

Asked: Oct 02 '12 at 16:50

Seen: 725 times

Last updated: Oct 02 '12 at 16:52

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited