简体   繁体   English

在cygwin / XP下安装完整Python的最佳方法是什么?

[英]Best way to have full Python install under cygwin/XP?

Pythons installed under WinXP have dirs like DLLs, DOC, include, etc. but python (2.5) installed with cygwin is a bare python.exe. 在WinXP下安装的Pythons有dirs,如DLL,DOC,include等,但安装了cygwin的python(2.5)是一个裸的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; 我的动机是,XP下的“事物”似乎并没有在cygwin下找到“其他东西”,反之亦然,我想用Qt开始开发,我喜欢shell,我不喜欢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? 1.我可以简单地将XP安装的内容复制到cygwin树中吗? 2. Is the XP flavor of Python different from the cygwin flavor? 2. Python的XP风味是否与cygwin风味不同? (Same CPU, he pointed out, naively.) 3. Someone must work with a full-fledged (if snakes had feathers...) Python from within cygwin; (同样的CPU,他天真地指出。)3。有人必须使用完全成熟的(如果蛇有羽毛......)来自cygwin内部的Python; how is it done? 怎么做?

Disclaimer 1: I have never compiled anything under XP or cygwin; 免责声明1:我从来没有在XP或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. 免责声明2:对不起,如果这是一个ServerFault问题,但他们似乎是那里的系统人员,这是(在我的情况下)一个低桌面。

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). 我在cygwin中使用Python,但我没有使用cygwin为您提供安装选项的版本,因为我没有对所需的版本号的控制(我们在工作中使用旧版本)。 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. 我通过Windows安装程序安装了我的python版本(放置它的xp版本)并将/ cygdrive / c / Python2x目录添加到我的PATH环境变量中。

好吧,在我的Windows环境中,我使用活动的python ,到目前为止,它对我有用。

Just a little off the question, but... 只是有点问题,但......

Have you considered running Sun's VirtualBox with Fedora or Ubuntu inside of it? 您是否考虑过使用Fedora或Ubuntu运行Sun的VirtualBox? I'm assuming you have to / need to use windows because you still are, but don't like it. 我假设您必须/需要使用Windows,因为您仍然是,但不喜欢它。 Then you would have python running inside a native linux desktop without any of the troubles you mentioned. 然后你就可以在本机linux桌面内运行python,而不会遇到任何麻烦。

And if you want something that is really easy and portable, then just use Python on Windows, not mixed in with cygwin. 如果你想要一些非常容易和可移植的东西,那么只需在Windows上使用Python,而不是与cygwin混合使用。

$0.02 $ 0.02

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... 这可能没什么价值,但是......我发现自己处于这种情况 - 我们在生产中使用ActivePython2.5(纯Windows环境),我试图在cygwin和cygwin的Python中进行我的开发......

After ripping out half of my hair, I have now switched over to Console2, gvim, iPython and ActivePython2.5. 撕掉一半头发后,我现在切换到Console2,gvim,iPython和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. 我对处理Windows工具(及其伴随的疣)的兴趣并不高兴,但至少在开发方面我并没有以自己的方式处理。 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. 祝你好运。

I accidentally stumbled on this - If I launch Cygwin from the Cygwin.bat file (which is present directly under the main folder), I get access to the Python version installed under Cygwin (ie 2.6.8) 我偶然发现了这个 - 如果我从Cygwin.bat文件(直接存在于主文件夹下)启动Cygwin,我可以访问Cygwin下安装的Python版本(即2.6.8)

If I instead launch the Cygwin from bash.exe under bin directory (C:\\Cygwin\\bin\\bash.exe for me), running "Python -V" shows that I have access to 2.7.3 version of Python (that was installed for Windows). 如果我改为从bin目录下的bash.exe启动Cygwin(对我来说是C:\\ Cygwin \\ bin \\ bash.exe),运行“Python -V”表示我可以访问2.7.3版本的Python(已安装)对于Windows)。

So, I guess you can do the same. 所以,我猜你也可以这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM