Monday, August 10, 2009

workaround: easy_install windows vanish

My employer-mandated Vista machine has gone almost unused for months because of an infuriating quirk in Vista's command-prompt operation. I've come as close to completely forgetting how to use Windows as I've ever been. Giles Thomas (of Resolver Systems) saved me.

The problem: Vista runs programs like easy_install in a new cmd window, separate from the one they were invoked in. The instant the program terminates, the new window is closed, and any messages it returned - like error messages - are lost. No, redirecting the messages with > and 2> does not work. "Why would you want to see error messages, anyway? They're so geeky and depressing!" *gum snap*

Thus, I was unable to install cx_Oracle, and had to turn to my trusty Ubuntu machine for absolutely every pyOraGeekish task.

Giles blogged a lifesaver workaround. If you can run the cmd window as Administrator in the first place, you are entrusted with the awesome power and responsibility of being allowed to view your own error messages.

So, now I can blow the dust off my Vista machine. Wow, controlling the font size of a cmd window is absolutely as primitive as it was in Windows 3.1. Giles, got a workaround for this, too?


wam said...

Why not ditch the windows terminal and go with something like rxvt (which has a native mode under Windows, so it doesn't require an X-server to run). I most often use rxvt to launch my cygwin bash shells, but you can get it run cmd.exe for you as well by setting shortcut for:

C:\cygwin\bin\rxvt.exe -e /cygdrive/c/WINDOWS/system32/cmd.exe

Rob K said...

I was going to suggest installing cygwin and using bash. Add cygwin/X to use rxvt (or xterm) and run X programs from your Ubuntu box right on your Windows desktop.

Rob K said...

Something maybe even better, with cygwin, install 'chere'. "chere adds the term/shell combination to the folder context menu. This allows you to right click a folder in Windows Explorer and open shell in that

This is like the windows "command prompt here" powertoy.

Giles said...

Hi Catherine -- glad to help! Sounds like I should be looking at cygwin too, though.



Anonymous said...

One of the first things I install (although it just needs copying, not installing) on Windows machines is Console2 - - a great replacement for the CMD window.

It is very configurable and I usually set it up so that I can launch new tabs or windows with a dos shell, a cygwin shell or an iPython session simply by pressing a key combination (or selecting from a pull down menu).

PJE said...

Just a quick FYI: check to make sure your easy_install.exe has an easy_install.exe.manifest file (created by easy_install itself). If not, you probably don't have a recent enough version of setuptools, and that's what's causing the problem.

(If the .manifest file isn't there, you'll get a UAC request and a separate window opens. With the manifest, it should work in the same command window.)