Monthly Archives: May 2013

Installing Scipy on Linux Red Hat

Tried to install scipy using easy_install (also pip). Installation failed with error: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Instead: sudo yum install scipy works seamlessly

Posted in EC2, Machine Learning, Programming, Python | Leave a comment

Resolving import errors in Python

If you get an error saying something like ‘Can not import SomeModule”, the first thing to check is that package (which is a regular directory with added __init__.py file) is in PYTHONPATH. For example, suppose you get an error when … Continue reading

Posted in Python | Leave a comment

Switching back and forth between tabs and spaces for Python indentation

It seems that majority of python developers prefer using 4 spaces for indentation. However, some people still like using tabs. I am using python.vim script written by Eric Mc Sween. The file stays in .vim/indent directory. There is a line … Continue reading

Posted in Uncategorized | Leave a comment

Problems with character encoding when piping output from a python script to a file

Suppose my_unicode_string is a Python unicode string. If you get an error when you do the following: and the error is: UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xf1′ in position 9: ordinal not in range(128) To get rid of the … Continue reading

Posted in Programming, Python | Leave a comment

Installing extensions for Mercurial

Detailed instructions are here. Create forlder ~/.hgextensions Copy extesion files to this folder. Open ~/.hgrc Mercurial’s config file and add [extensions] section. It might look something like: At the moment of this post Kiln did not support SSH connection. Kilnauth … Continue reading

Posted in Mercurial, Productivity, Programming | Leave a comment