Thursday, August 12, 2010

easy_install how I wish ...

I use a lot of easy_install during the day to manage my packages. First off the bat let me just get this off my chest, I hesitated like about 10 times before writing this article, for fear of getting panned all the way to Sunday, but then Sunday isn't really that far away so here goes. Also, before that if you are going to pan me or burn my ass for not reading docs at least at the end of it disseminate some useful info at the end of the burning comment so that everybody can benefit from it. God knows I would appreciate it.

I was doing some stuff on Pylons and for some reason Routes-1.12 was screwing stuff up, so I had to downgrade Routes by doing something like:

easy_install 'Routes<1.12' and it did it's work well enough.

Two thoughts itched at my thoughts though ... the whole experience of downgrading Routes felt a little bit too deja-vuish to be comfortable. Did I not do this before the other day? I could have sworn it was working the other day with Routes-1.11. All of this mental itching started a seed of mistrust for my hithero good simple friend easy_install.

Anyways, I just proceeded but now with an eye on my friend in the corner just to check up on what the macha was doing. I tried to find out the version of route that was running from easy_install, hmmm there was no way of doing that! At this point I just hear those magnums and AK-47s from all of you Python elites ready to blow me to kingdom come, as they always say "easy_install is meant for easy installing!" Okay okay, but is it so very hard to write it so that we can do something like:

'easy_install query Routes' ??

Remember pan me at this point if you want if you know that easy_install can do it somehow with some black magicks but at least let everybody know how. In the end I settled for this:

'python -c 'import routes;print routes.__path__'

Sigh ... I know my ass is just going to be hurting after this ....

4 comments:

Wyatt said...

I don't think the easy_install command itself can do that, but this might work for you:

import pkg_resources
pkg_resource.get_distribution('routes').version

You can also look in the easy-install.pth file in your site-packages directory for the relevant line.

lowkster said...

Yeah, as I found out, sure wish it added that little bit of functionality though.

Anonymous said...

For that matter, pip, which is often touted as a superior replacement for easy_install, doesn't have a 'pip version $packagename' either.

OmahaPythonUsersGroup said...

easy_install yolk
yolk -l

http://pypi.python.org/pypi/yolk