在 cygwin/XP 下安装完整 Python 的最佳方法?
WinXP 下安装的 Python 具有 DLL、DOC、include 等目录,但使用 cygwin 安装的 python (2.5) 是一个裸露的 python.exe。 我问的动机是XP下的“东西”似乎在cygwin下找不到“其他东西”,反之亦然,我想开始用Qt开发,我喜欢shell,我不喜欢MS; 我想,如果我将所有组件集中在一个屋檐下,我终于可以开始让脚本查找可以查找文件等的可执行文件。 1. 我可以简单地将 XP 安装的内容复制到 cygwin 树中吗? 2. Python XP 风格与 cygwin 风格不同吗? (同样的 CPU,他天真地指出。) 3. 必须有人在 cygwin 中使用成熟的(如果蛇有羽毛的话……)Python; 它是如何完成的?
免责声明1:我从未在XP或cygwin下编译过任何东西; 我本来希望不必去那里,因此,Python 摆在了第一位。 免责声明 2:抱歉,如果这是一个 ServerFault 问题,但他们似乎是那边的系统人员,而这(就我而言)是一个低级桌面。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我在 cygwin 中使用 Python,但我不使用 cygwin 提供的安装选项,因为我无法控制我需要的版本号(我们在工作中使用旧版本)。 我通过 Windows 安装程序安装了 python 版本(您所说的 xp 版本),并将 /cygdrive/c/Python2x 目录添加到我的 PATH 环境变量中。
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.
好吧,在我的 Windows 环境中,我使用 active python ,到目前为止,它对我有用。
Well, in my windows environment I use active python and it, so far, works for me.
只是有点偏离问题,但是...
您是否考虑过在其中运行带有 Fedora 或 Ubuntu 的 Sun 的 VirtualBox? 我假设您必须/需要使用 Windows,因为您仍然使用 Windows,但不喜欢它。 然后你就可以在本地 Linux 桌面上运行 python,而不会出现你提到的任何问题。
如果您想要真正简单且可移植的东西,那么只需在 Windows 上使用 Python,而不是与 cygwin 混合。
0.02 美元
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
这可能没有什么价值,但是...我发现自己处于这种确切的情况 - 我们在生产中使用 ActivePython2.5(纯 Windows 环境),并且我试图在 cygwin 和 cygwin 的 Python 中进行开发...
在撕掉之后一半的头发,我现在已经切换到Console2、gvim、iPython和ActivePython2.5。
我对处理 Windows 工具(及其伴随的缺点)不太感兴趣,但至少在开发方面我没有妨碍自己。 有一段时间,我发现我花在尝试让我的工具发挥良好性能上的时间比实际完成任何工作的时间还要多。
祝你好运。
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.
我偶然发现了这一点 - 如果我从 Cygwin.bat 文件(直接位于主文件夹下)启动 Cygwin,我可以访问 Cygwin 下安装的 Python 版本(即 2.6.8)
如果我从bin 目录下的 bash.exe (对我来说是 C:\Cygwin\bin\bash.exe),运行“Python -V”显示我可以访问 2.7.3 版本的 Python(为 Windows 安装)。
所以,我想你也可以这样做。
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 (i.e 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).
So, I guess you can do the same.