I realise that this post could be a bit ‘Duh!!’ to most seasoned pythonistas but I shall persevere with it just for the small numbers for whom this issue is genuinely perplexing. So, getting Enthought Chaco is supposed to be piss easy in Ubuntu. Simply type in easy_install Chaco and you should have it! Right?? No!! Turns out that if you’re python path is not pointing to the right directory, ipython or whatever python shell you use will simply not import the newly installed package(s). Here is what you do:
1. Go into ipython
2. Check your pythonpath by typing:
import sys
for line in sys.path: print line

3. This will bring up some list of directories which are already in pythonpath. Bear in mind here that messing around with .bashrc doesn’t really help if you do all your python-ing in the ipython shell!

4. Then, when you try to import chaco, here is what happens:

5. Slowly, do a trawl of your filesystem to find where chaco actually is.
6. I found it in:
7. Add this directory to pythonpath.

8. And, there you have it!!

9. Oh, and for those stuck even before the easy_install part, check that ‘setuptools’ is installed on your system. Without that, easy_install doesn’t work.

Advertisement