IPython Issues

Jan 24, 2013 at 4:31 PM

I have read all the IPython discussions, etc., and I must be missing something.  I can not get this to work.

When I type anything at the command, I get an infinite hang.  Sometimes I get the command-line help for IPython and then a hang.

If I set the interactive mode to "IPython w/o pylab' I get:

"IPython mode requires IPython 0.11 or later: IPython.zmq requires pyzmq >= 2.1.4"

I have the latest IPython .13 I believe. If I have just "IPython", I get an inifite hang.

And I am confused about what I set up as the interpreter...do I set a path to "ipython" or the underlying "python.exe" that Ipython.exe is installed on?

Could really use some help on basic setup instructions for IPython.   I have been very successful setting up and using many other python variants, 32 and 64bit and 3.x and 2.x, but I am obviously missing something as to how to set up an ipython repl.

Coordinator
Jan 24, 2013 at 6:07 PM

It sounds like you already have it set up, so there may be something else going on here. Are you able to start IPython using the regular console window?

You will need matplotlib installed to use "IPython" mode, but "IPython w/o pylab" should be fine. pyzmq can be installed separately - if you're not using easy_install (either from distribute or setuptools) then I'd strongly recommend it - with easy_install pyzmq. (I'll create a task to improve that error message, since the problem is very much pyzmq and not IPython, so we should be clearer about that.)

For PTVS, the only setup required is changing the interactive mode, which you have done. If you have multiple versions of Python installed side-by-side, you need to make sure that you change the setting for the correct interpreter and use the correct interactive window, but that's it. Anything else is probably a bug, so let's see whether pyzmq fixes it and if not then we'll look into what could be going really wrong (and we'll look into the hang anyway, but I suspect that's due to missing dependencies).

Jan 24, 2013 at 7:02 PM

Done all of this, same problem, nothing seems to help. 

1) ipython works like a champ on the command line, so I know it is installed correctly.  I had been using this standalone for some time, actually, and then I thought, "Man, I really should be using this in PTVS as the console instead of running it side by side."  So my integration with PTVS is new, but ipython works well and I've been using it for awhile.

2)I did an easy_install of pyzmq, so that is in now.

3) I am certain I have it in "IPython" interactive mode.  Have tried both w pylab and without.  I use matplot lib extensively, so that is already installed and I know it works.

One thing I do not understand...when I am supposed to specify the path to my interpreter, should I be routing it to ipython.exe or python.exe?  I have tried both ways, neither works, but I do get different behavior whichever what I go.   Is the idea that I am running python as always, but by selecting the IPython mode, PTVS automatically routes through ipython?  Or do I need to treat iPython as if it was, itself, a python.exe?

 

Coordinator
Jan 24, 2013 at 7:13 PM

You shouldn't need to set the interpreter path at all unless we don't detect the interpreter, and then you'll set the path to regular python.exe. If we're not detecting the interpreter then you've probably got a non-standard setup (maybe one of the scientific distributions?) but setting the interpreter path and version should be sufficient.

In IPython mode we basically do an "import IPython" and some other work to forward statements to IPython's processor rather than eval(). So if in the normal interactive mode setting you can do an "import IPython" there's no reason why the IPython mode should fail.

Did the error message change with pyzmq installed?

Jan 25, 2013 at 2:43 AM

I installed ipython from a binary at http://www.lfd.uci.edu/~gohlke/pythonlibs/, which is goto place for precompiled stuff for windows (given that you can never get visual studio to build anything for python on windows).

The installation is good. IPython runs well.  I install pyzmq so that message went away, but the underlying issue is the same. 

So let me make sure I understand what you are saying so I can troubleshoot.

1)  if I am running a regular python session, "import ipython" should work.  If it works for me there, it should work for PTVS.  But if that DOESN'T work, then we have a problem with installation.

2) I do NOT need to specify any path to python.exe if I am in IPython eval.  PTVS will simply turn to IPython automatically.

3) is there a recommended way I should get/install IPython such that PTVS is sure to pick it up?

 

Jan 25, 2013 at 2:44 AM

I should also add that I am 64bit for my python.   Could that be an issue?

Jan 25, 2013 at 2:54 AM

Ok...so I seem to have gotten it working.

I had to:

 

1) put in the path to pythonw.exe and NOT python.exe. Once I did that it started working.

I think that is the main thing. 

So you do need a python path to the regular pythonw exe, and you need to be in ipython interactive mode and one must be able to import ipython from the interpreter in question for this to all work.

I will work with it for awhile and make certain all works well...


Thank you for your help...

Coordinator
Jan 25, 2013 at 3:43 AM

I'm curious why we didn't simply auto-detect your Python installation - typically you shouldn't have to manually configure your interpreter.  How did you install Python?  It might be interesting if you could go to Tools->Python Tools->Diagnostic Info and post that info here.  That'll include the interpreters you have registered and how they're setup.  But no matter what I'm glad you were able to get it working!

Jan 27, 2013 at 3:32 PM

I tried copy pasting the diag info, but it was too large, the forum won't take it.

 

Is there a part of it I can take out that would help?

Coordinator
Jan 28, 2013 at 3:42 AM

You're best to email it to ptvshelp@microsoft.com. Include a link to this discussion so we can match it up.