programming

Installing MySQL for Python in Ubuntu

0

иконографияКартинивик услугиWhilst on the grind this evening, hacking on some Python code in a newly-installed Ubuntu virtual machine, I needed to install MySQL for Python. Building the package, pre-installation, requires mysql_config — which I had some difficulty locating in the repositories. After flailing about a bit, the solution is to install the libmysqlclient-dev package.

$ sudo apt-get install libmysqlclient-dev

The package also requires setuptools, which is available here. Download it (I’m running Python 2.6.5, so I downloaded setuptools-0.6c11-py2.6.egg) and run it as a shell script.

$ sh ~/Downloads/setuptools-0.6c11-py2.6.egg 

A second error — i.e. gcc could not find python.h — was resolved by installing the Python development package.

$ sudo apt-get install python-dev

Back to it …

Core Dumps in Ubuntu

0

I resolved this year that I would take time to pursue one of my passions — computer science. As such, I am learning how to write applications for Linux. I’ve just spent 30 frustrating minutes trying to figure out why on earth my deliberate segmentation fault in the small C program I have written is not producing a core dump in Ubuntu 9.04. It turns out that Ubuntu disables core dumps in Bash by default. The fix is simple enough — use the ulimit command to enable core dumps.

bash$ ulimit -c 100

In this case I have enabled core dumps and given them a limit of 100 blocks. Problem solved! Hopefully this makes it into the search engines and helps someone else frustrated by this same issue.

Go to Top