views:

405

answers:

4

Pythons installed under WinXP have dirs like DLLs, DOC, include, etc. but python (2.5) installed with cygwin is a bare python.exe. My motivation for asking is that 'things' under XP don't seem to be finding 'other things' under cygwin and vice versa, I want to start developing with Qt, I like shells, and I do not like MS; I thought if I got all the components under one roof, I could finally start to have scripts find executables which could find files and such. 1. Can I simply copy the contents of an XP installation into the cygwin tree? 2. Is the XP flavor of Python different from the cygwin flavor? (Same CPU, he pointed out, naively.) 3. Someone must work with a full-fledged (if snakes had feathers...) Python from within cygwin; how is it done?

Disclaimer 1: I have never compiled anything under XP or cygwin; had hoped not to have to go there, hence, python in the first place. Disclaimer 2: sorry if this is a ServerFault question, but they seemed to be system people over there and this is (in my case) a lowly desktop.

A: 

Well, in my windows environment I use active python and it, so far, works for me.

shylent
"I'm not going to spend a lot of money for this muffler", I think the line goes. I like "free". I like trying the new versions. I like my shells (even if bash baffles me at times). I like my gvim. Will I be happy with Active Python?
behindthefall
Money? Hmm, I guess that was some kind of metaphor, now, was it? :) Because, you do not need to pay for it and you can redistribute active python verbatim. They also have a 3.x version (3.1 I think it is). It is a kind of "batteries included" distribution, so you get all the standard libraries bundled with it. I couldn't find a single reason why shouldn't I use it when I am under windows.
shylent
A: 

Just a little off the question, but...

Have you considered running Sun's VirtualBox with Fedora or Ubuntu inside of it? I'm assuming you have to / need to use windows because you still are, but don't like it. Then you would have python running inside a native linux desktop without any of the troubles you mentioned.

And if you want something that is really easy and portable, then just use Python on Windows, not mixed in with cygwin.

$0.02

gahooa
Intriguing. What do you have to do: provide a clean, formatted disk, install the VirtualBox, and then start adding in OSes? Does MS and their anti-piracy snooping object? Who takes care of the drivers for hardware, etc.? (That's what made me give up on various Linuces some years back.)
behindthefall
If I understand what I read on the VB site, you have a machine with a host OS (here, XP). You install VB. You install virtual machines for more OSes. Q: Do the OSes all have access to all the files; e.g., if I write something in, say, gvim installed under XP, would a Python script installed in a Linux virtual machine see those files? If not, then what would I have gained?
behindthefall
@behindthefall: what is it you are trying to accomplish? If it's to work with a full python from XP, then why not just install python and gvim and have at it?
gahooa
+2  A: 

I use Python from within cygwin, but I don't use the version that cygwin gives you the option of installing as I don't have the control over version number used that I need (we use an older version at work). I have my python version installed via the windows installer (the xp version as you put it) and add the /cygdrive/c/Python2x directory to my PATH environment variable.

Mark Roddy
That's the arrangement I've been using, but (see a question I asked last night) things can't find other things. I would be VERY grateful if you could provide details on how you make it all work together!!
behindthefall
You have to make sure all the 'things' that python will need outside of cygwin. For instance, if you install Qt via cywin your python install will not find it. You need to install all your libraries via windows to ensure that they end up where your python install can find it.
Mark Roddy
That's what I've been doing, and things haven't been seeing each other, which why I started wondering about getting everybody inside cygwin's tent. I'd give you an example from earlier today, but the details have slipped my mind, and XP (typically) insisted on rebooting the system, so ... no example.
behindthefall
Can you confirm whether or not, when you install everything via Windows (not cygwin), that python can find everything when you run it from windows (using cmd.exe as your shell instead of sh.exe). If not that the problem is not with cygwin at all.
Mark Roddy
Ah. Well, there's the problem, you see. (not insuperable, but ...) I avoid cmd.exe totally; not a clue how to use it; just averse to it; don't like it; think it's badly designed. Silly of me. I'll see what I can do. Any hints?
behindthefall
Create a python script that imports the libraries that Python can't find when you run them under cywin. Run cmd.exe (Start -> Run -> type 'cmd.exe'), and execute the python script from this command line.
Mark Roddy
Hokay --- you're going to make me take the plunge. ;-) (Do you know how many years I have avoided MS cmd.exe? Since 'round about DOS. Why'd they go and (re)invent a square wheel when UNIX and (c)sh were sitting right there? Oh. Silly question.)
behindthefall
BTW -- In the seconed comment you write: "You have to make sure all the 'things' that python will need outside of cygwin." What's the missing word or words between 'need' and 'outside'? (I assume something was supposed to go in there ...)
behindthefall
Sorry. "You have to make sure all the 'things' that python will need are installed outside of cygwin". So if you need PyQt install it from a windows installer and not a cygwin package. Otherwise your python install will not be aware of its presence.
Mark Roddy
A: 

This probably has little value, but... I found myself in this exact situation -- we use ActivePython2.5 in production (pure windows environment) and I was trying to do my development within cygwin and cygwin's Python...

After ripping out half of my hair, I have now switched over to Console2, gvim, iPython and ActivePython2.5.

I'm less than thrilled dealing with Windows tools (and their concomitant warts), but at least I'm not getting in my own way when it comes to development. For a while I found I was spending more time trying to get my tools to play nice than actually getting any work done.

Good luck on this one.

dreynold
Can you describe your setup? I'd love to see a way out of this.
behindthefall
Have you any experience with Python(x,y)? That might turn out to be a godsend for what I want to do eventually.
behindthefall
BTW -- Sorry to hear about your hair. Hope the loss was symmetrical.
behindthefall