Home > linux > libmysql-dev missing on a webhoster when trying to install mysql-python

libmysql-dev missing on a webhoster when trying to install mysql-python

can be a pain in the arse . . .
As I had to do this a couple of times lately, here is a annotated snippet of my bash history. This is mainly a “note to self”:

#install virtenv
curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz
tar xvfz virtualenv-1.9.1.tar.gz
mkdir src app bak
mv virtualenv-1.9.1.tar.gz bak/
mv virtualenv-1.9.1 src/
python src/virtualenv-1.9.1/virtualenv.py app/
. ./app/bin/activate
# try to install - it will fail with missing libmysqlclient headers and stuff
pip install mysql-python
uname -a
cd src/
# get the package we cannot install (no root/sudo) 
wget http://security.debian.org/debian-security/pool/updates/main/m/mysql-5.1/libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb
ar x libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb
mkdir libmysqlclient-dev
mv control.tar.gz libmysqlclient-dev/
mv data.tar.gz libmysqlclient-dev/
mv libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb libmysqlclient-dev/
cd libmysqlclient-dev/
tar -xzf data.tar.gz
cd usr/
cd bin/
cp mysql_config /home/william/app/bin/
cd ..
cd include/
cp -a mysql /home/william/app/include/
cd ..
cd lib/
cp -a * /home/william/app/lib/
cd ..
cp -a share /home/william/app/
cd ~
vim .bashrc
#[logout and in to activate bashrc changes]
. ./app/bin/activate
#try again - it will report the missing libs that cat be found in /usr/lib
pip install mysql-python
cd app/lib/mysql/
cp /usr/lib/libmysqlclient* ./
cd ~
# try a third and hopefully last time
pip install mysql-python

Willi

Categories: linux Tags:
  1. September 19th, 2014 at 04:38 | #1

    So, the point is that no matter what surface are you working on there must be a polishing pad that is perfect for the job.
    You can call the nearest marble polishing agency to carry out the job in an effective manner.
    It is his responsibility to gist you a suitable working environment.

  1. No trackbacks yet.