使用两个版本的Python安装IPython(Windows) [英] installing IPython with two versions of Python (Windows)
问题描述
是否可以在具有两个不同版本的Python(v 2.7和3.2)的相同的
系统上安装 IPython(0.12)?目前我在我的系统上运行了两个版本的Python。
Is it possible to have IPython (0.12) installed on the same system with two different versions of Python (v 2.7 and 3.2)? Currently I have both versions of Python running happily on my system.
我使用两台机器,一台使用 Windows 7 64位,其他 XP SP2 32位,并且都安装了 Python 2.7.2 和 3.2 。我一直在使用Python 2.7和没有任何问题的IPython两次。
I am using two machines, one with Windows 7 64-bit, the other XP SP2 32-bit, and both have Python 2.7.2 and 3.2 installed. I have been using IPython with Python 2.7 w/o any problems for a while on both.
现在我想通过IPython获得3.2,但是当我尝试运行二进制窗口IPython安装程序我在安装结束时收到此错误:
Now I would like to have 3.2 available too with IPython, but when I try to run the binary windows IPython installer I get this error toward the end of the install:
*** run_installscript: internal error 0xFFFFFFFF ***
并且没有创建开始菜单等的快捷方式/条目。
(我在Win 7下运行安装为管理员)我遇到了与XP和Win 7相同的问题。
and no shortcuts/entries into Start Menu etc are created. (I ran the install as adminstrator under Win 7) I am running into the same problem with XP and Win 7.
在网络上搜索和SO之后有一段时间我看到了
获得 setuptools 的参考资料。不幸的是,Python 3.x
没有版本,但建议使用发布.py 代替我运行并安装了
。我不知道接下来该怎么办。而且我甚至不确定
是否可以这样做(虽然我认为是:)
After poking around the net and SO for a while I saw references for getting setuptools. Unfortunately, there's no version for Python 3.x but it was suggested to use distribute.py instead which I ran and installed. I am not sure how to proceed next. And I'm not even sure it is possible to do this (though I think it is :)
有什么建议吗?
更新:导入readline
无法使用Python 3.2.3,但我可以通过下载 pyreadline-2.0-dev1.win32.exe ,它适用于Python 3.2.3 ..上述问题仍然不幸。
UPDATE: There was a problem with import readline
not working with Python 3.2.3, but I was able to fix it by downloading pyreadline-2.0-dev1.win32.exe which works with Python 3.2.3 .. the above problem remains unfortunately.
推荐答案
好的,这是我的解决方案,让 IPython 0.12.1 与 Python一起使用同一系统上的ver
2.7.x和3.2.x (即 Windows 7 64位和 XP SP2 32位)。这不是
完美,但有效,并希望能帮助别人。我在哪里显示目录,他们指的是XP(但应根据Windows 7进行相应调整)
Ok, here's my solution to get IPython 0.12.1 to work with both Python ver 2.7.x and 3.2.x on the same system (ie. under Windows 7 64 bit and XP SP2 32 bit). It's not perfect, but works, and hopefully will help others. Where I am showing directories they refer to XP (but should be adjusted accordingly for Windows 7)
两者的步骤:
-
通过
Python.org
安装此版本的pyreadline pyreadline-2.0-dev1.win32.exe ,对于两个版本的Python都有
(我无法获得广泛使用的版本1.7)使用Python 3.2.x)
Install this version of pyreadline pyreadline-2.0-dev1.win32.exe which works for both versions of Python (I could not get the widely available version 1.7 to work with Python 3.2.x)
我不确定 distribute.py 是必要的,我会先在
上跳过它。
I am not sure if distribute.py is necessary, I'd skip it on the first try.
下载 ipython-0.12.1.zip 文件并提取它。把它放在你的程序目录下并插入它(我称之为 ipython_dir
)[我多次试用二进制安装程序但没有成功]
Download ipython-0.12.1.zip file and extract it. Place it under your Programs directory and cd into it (I'll call this the ipython_dir
) [I tried the binary installer numerous times without success]
对于Python 3.2(更简单)
在 ipython_dir
:
c:\python32\pyton.exe setup.py install
将创建 ipython3.exe
在 c:\ python32 \Scripts
中,可用于
启动iPython
will create ipython3.exe
in c:\python32\Scripts
that can be used to
fire up iPython
对于Python 2.7(有点奇怪)
上述方法失败。但是,可以使用
The above method failed. However, it is possible to start IPython from the ipython_dir
with
c:\python27\python.exe ipython.py
我无法解释为什么会这样,但由于我使用 Console2 ,我可以隐藏
这两种启动IPython的方式。
I can't explain why this is so, but since I use Console2 I can hide these two ways of starting IPython.
摘要:
使用v 2.7.x的Python启动IPython:
To start IPython with v 2.7.x of Python:
c:\python27\python.exe "C:\Program Files..\ipython_dir\ipython.py"
使用v 3.2.x的Python启动IPython:
To start IPython with v 3.2.x of Python:
c:\python32\Scripts\python3.exe
这是很多工作并占用了大部分时间,所以我希望发布上面
以上的步骤可以节省其他人很多时间(并帮助我记住我下次要做的事情)我为此付出了努力)
That was a lot of work and took most of the day, so I hope posting the steps above will save someone else a lot of time (and help me remember what I have to do next time I struggle with this)
谢谢前夕ryone为他们的建议。
Thanks everyone for their suggestions.
附录:以上都没有导致开始/程序菜单中的快捷方式或条目。可以手动创建快捷方式,或者在我的情况下没有必要,因为我使用特殊的shell(Console2)来运行IPython。
Addendum: None of the above resulted in shortcuts or entries in the Start/Program Menus. Shortcuts can be created manually, or in my case aren't necessary since I'm using a special shell (Console2) to run IPython.
这篇关于使用两个版本的Python安装IPython(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!