3

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.

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.

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 ***

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.

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 :)

Any suggestions?

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.

9
  • I don't know about windows but it works in Arch Linux. Commented May 28, 2012 at 16:19
  • You have two different version of Windows installed as well as Python? Commented May 28, 2012 at 16:34
  • @martineau No, sorry, I am trying to have this setup (iPython with Python 2.7 and 3.2) on two different machines, one running XP the other Windows 7. Commented May 28, 2012 at 16:36
  • Have you tried running the binary installer after you installed distribute? Commented May 28, 2012 at 17:14
  • @ThomasK Yes (multiple times :-/ ) .. still end up with the same error message, and no entry in the start menu etc. Commented May 28, 2012 at 17:14

2 Answers 2

5

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)

Steps for both:

  1. Install both versions of Python via the binary windows installer provided at Python.org

  2. 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)

  3. I am not sure if distribute.py is necessary, I'd skip it on the first try.

  4. 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]

For Python 3.2 (easier)

In the ipython_dir:

c:\python32\pyton.exe setup.py install

will create ipython3.exe in c:\python32\Scripts that can be used to fire up iPython

For Python 2.7 (a bit odd)

The above method failed. However, it is possible to start IPython from the ipython_dir with

c:\python27\python.exe  ipython.py

I can't explain why this is so, but since I use Console2 I can hide these two ways of starting IPython.

Summary:

To start IPython with v 2.7.x of Python:

c:\python27\python.exe "C:\Program Files..\ipython_dir\ipython.py"

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)

Thanks everyone for their suggestions.

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.

Sign up to request clarification or add additional context in comments.

4 Comments

IIRC, you need distribute if you want the binary installer to make shortcuts in the start menu for IPython. I'm not sure why installing it didn't work for Python 2.7, that's certainly possible.
@ThomasK I thought so too, but that didn't work for me either.
If you've got time to test this sort of thing, it would be great to have some more hands making sure it works well on Windows. I think the first thing would be to get a clean machine (perhaps a VM) and see if we could replicate the sort of problems you had. If you're interested, drop us a line on the mailing list: mail.scipy.org/mailman/listinfo/ipython-dev
@ThomasK Thanks for the suggestion of the VM, didn't even think of that .. duh! :) .. if I figure out something, I'll be sure to share. I really like the IPython environment, and I know I haven't even fully started to explore/exploit it .. I mostly use it as a simple shell.
1

The first question in the iPython FAQ titled "Running IPython against multiple versions of Python" may help.

3 Comments

thanks for the link, I'm not quite sure how to translate that to my Windows environment. I remember having problems with the initial installation too .. (I've seen a fair number of problem reports with Windows installs). I'm sure this would be easier under Linux (which seems much more flexible)
@Leveon: I think you just need to translate the path portion of --prefix=$HOME/usr to where the site-packages for each of the two Python interpreters are installed on your system (as well as the beginning interpreter invocations, of course).
I figured out some sort of solution ... finally. Oof.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.