Python’s module search path

Upgrading software on an Ubuntu 12.04 machine, I hit a snag. A daemon wouldn’t start. The error log showed the following: from util.pystone import pystones ImportError: No module named util.pystone Reading a little, pystone is used in benchmarking and comes with Python 2.7. Yep, it’s there. $ ls /usr/lib/python2.7/test __init__.py __init__.pyc pystone.py pystone.pyc regrtest.py regrtest.pyc test_support.py test_support.pyc Strange. Firing up python and importing this from the python prompt failed. I tried only specifying this path to see if it would import: [Read More]

dirty python network graphite hacks

I’ve been pushing historical temperature data for Vancouver into a local graphite instance using python. While pushing the data, I received this error: socket.error: [Errno 99] Cannot assign requested address This was strange, as I had been using the address in the loop many, many, MANY times before hitting this error. A little more sleuthing uncovered a ton of connections in the TIME_WAIT state. Around 26,000 open sockets was where I couldn’t open any more. [Read More]

Sleep data graphs

I’ve been using the Sleep as Android app to track my sleep for a little while now. The application allows exporting to CSV files. I thought, “GREAT! I can bash in some, well, BASH and put this in Graphite". You know to look at it in relation to other things I’m tracking and wastes of time like that. I cracked open the CSV and immediately noticed it was REALLY whacky. Okay, well, not whacky, just not what I expected. [Read More]