Making iPython Virtualenv Aware

iPython is a great replace­ment for the stan­dard Python shell, but, out of the box, it doesn’t play well with virtualenv.

This can be fixed with a cou­ple of changes:

In the ter­mi­nal gen­er­ate an iPython default con­fig file:

ipython profile create

Open the newly gen­er­ated file:

vi ~/.ipython/profile_default/ipython_config.py

Add the fol­low­ing code at the end of the ipython_config.py file:

import site
from os import environ
from os.path import join
from sys import version_info

if 'VIRTUAL_ENV' in environ:
    virtual_env = join(environ.get('VIRTUAL_ENV'),
                       'lib',
                       'python%d.%d' % version_info[:2],
                       'site-packages')
    site.addsitedir(virtual_env)
    print 'VIRTUAL_ENV ->', virtual_env
    del virtual_env
del site, environ, join, version_info

And that’s it, iPython should now be vir­tualenv aware.

4 September, 2012 — one comment

MacIago for iPhone released

Finally, the long over­due ver­sion of MacI­ago for the iPhone has been released!

Get it here: MacI­ago iTunes link

16 March, 2011 — no comments

Moving to Linode

Being on a shared host quickly becomes a pain, spe­cially when you try to cus­tomize your shared envi­ron­ment, so I finally decided to upgrade to a VPS.

I’ve packed my bags from Bluehost.com and moved to the excel­lent Linode.com.

I chose the base 512MB plan, couldn’t be hap­pier. The extra con­trol you get over your instal­la­tion and the per­for­mance are a dra­matic improvement.

Well actu­ally I could, if you click on this Linode.com link, which has my refer­ral code, I’ll get some dis­count from them.

27 July, 2010 — one comment

iPhone Headphone Jack not Working

Well, some time ago my iPhone stopped rec­og­niz­ing the head­phones, it really looked like some hard­ware fail­ure, and I started to lose my hope, iPhone was 2+ years old, and a repair would be too costly for sure.

Well, after some googling around, it turns out that the solu­tion was pretty sim­ple, with an open paper clip just remove the accu­mu­lated lint inside the iphone’s head­phone jack!

How to Fix your iPhone Head­phones Mic If It’s Not Working

5 January, 2010 — 20 comments

Mockingbird

Inter­est­ing ajax based mockup appli­ca­tion, it works bet­ter than Bal­samiq Mock­ups although I do pre­fer Balsamiq’s sketchy looks.

Mock­ing­bird.

5 November, 2009 — no comments

Website Redesign

Finally after almost a year of inac­tiv­ity, I’ve man­aged to spend some time to bring rodesia.org back from the stale state it was.

The main rea­son for this had to do with Mephisto yet again drop­ping dead. So I had enough of it and decided to even­tu­ally move to another blog sys­tem, of course a year went by until it happened.

Now I’m using Word­Press and I couldn’t be hap­pier with the choice. Most of the posts have been migrated to Word­Press, but all the exist­ing com­ments have been lost. The design is also com­pletely new, sim­pler and richer in typo­graphic effects.

24 July, 2009 — no comments

Google App Engine

Google has just released what could be regarded as a bomb, the Google App Engine, basi­cally a devel­op­ment envi­ron­ment and scallable web host­ing, which even includes Google’s own data­base system.

It’s Python based, and even includes the Django web frame­work.

It looks like the pop­u­lar­ity of Python based devel­op­ment is going to explode…

8 April, 2008 — no comments

Installing PIL on the Mac

The Python Imag­ing Library, PIL, is a very use­ful addi­tion to your Python instal­la­tion if you need to manip­u­late pic­tures. Django uses it to val­i­date upload images for example.

On a Mac you do need to install lib­jpeg beforehand.

Install lib­jpeg:

  • Get the source: http://www.ijg.org/files/jpegsrc.v6b.tar.gz

  • Extract the archive.

  • Move inside the source direc­tory and exe­cute the fol­low­ing commands:

    cp /usr/share/libtool/config.sub .
    cp /usr/share/libtool/config.guess .
    ./configure --enable-shared
    make
    sudo mkdir -p /usr/local/include
    sudo mkdir -p /usr/local/bin
    sudo mkdir -p /usr/local/lib
    sudo mkdir -p /usr/local/man/man1
    sudo make install
    

Install PIL:

  • Get PIL at: http://effbot.org/downloads/Imaging-1.1.6.tar.gz

  • Extract the archive.

  • Move inside the source directory

  • Change the fol­low­ing val­ues in setup.py from the default None to:

    JPEG_ROOT = "/usr/local/include"
    ZLIB_ROOT = "/usr/local/include"
    
  • Check if every­thing is well configured:

    python setup.py build_ext -i
    python selftest.py
    
  • If no errors are found and the required libraries are installed (like JPEG sup­port), install PIL:

    sudo python setup.py install
    

And that’s it, I’ve tried this on Mac OS Leop­ard, and it works fine, let me know how it went for you.

14 March, 2008 — 3 comments

MacIago 3.6.2

I’ve just released a new update to MacI­ago, it fixes a nasty crash on 10.4 sys­tems that I wasn’t able to spot since I’m run­ning 10.5, also the game should prove to be more chal­leng­ing, with its improved arti­fi­cial intelligence.

MacI­ago Homepage

28 February, 2008 — no comments

MacIago 3.6.1

Just a minor and long over­due release that adds French and Japan­ese local­iza­tions to the game.

The Japan­ese trans­la­tion was done a long time ago by Christo­pher Li, who usu­ally releases a Japan­ese ver­sion of Maci­ago within a day or so after every release.

The French ver­sion was done by Yann Ricquebourg.

Thanks a lot guys!

MacI­ago homepage

19 February, 2008 — no comments


Older Posts