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 02 Oct '12, 16:50

seanf's gravatar image

seanf ♦♦
accept rate: 38%

edited 02 Oct '12, 16:52

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

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/
cd py3k/
python3.2 setup.py install --install-lib=$HOME/lib/python3.2 --install-scripts=$HOME/bin
permanent link

answered 02 Oct '12, 16:51

seanf's gravatar image

seanf ♦♦
accept rate: 38%

All goes well until command: "./build-py3k.sh". The message is: No such file or directory !!!

(19 Dec '13, 12:45) duke2007 duke2007's gravatar image

This procedure is over a year old, so the latest version of the software might require a different procedure.

(19 Dec '13, 12:54) seanf ♦♦ seanf's gravatar image

Thanks but if omit the segment "./build-py3k.sh cd py3k/" all is fine!! After command "cd PyMySQL" i try the last command, sure i change the version of python (3.3. in my case). And, work! Hi,Hi! After that i run python 3 command promt, import mymysql and work smoothly. I connect of one of my database, sure, before i start MySQL server... Anyway thank you very much! (Excuse my english, i am from Romania..).

(19 Dec '13, 13:12) duke2007 duke2007's gravatar image
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 02 Oct '12, 16:50

question was seen: 3,863 times

last updated: 19 Dec '13, 13:12

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited