Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%run filename autocompletion "The kernel heartbeat has been inactive ... " error #440

Closed
ghost opened this issue May 14, 2011 · 17 comments · Fixed by #542
Closed

%run filename autocompletion "The kernel heartbeat has been inactive ... " error #440

ghost opened this issue May 14, 2011 · 17 comments · Fixed by #542
Milestone

Comments

@ghost
Copy link

ghost commented May 14, 2011

It only happens when I run it as an application, with "Run in terminal" unchecked.
(When I run it in terminal, it does not happen)

When I press tab to autocomplete during the input of the argument of the run magic command, for example:

In [2]: %run 'work[TAB]

ipython-qtconsole hangs for a while, and then gives me the following error:

The kernel heartbeat has been inactive for 3.00 seconds. Do you want to restart the kernel? You may first want to check the network connection.

@ghost
Copy link
Author

ghost commented May 14, 2011

In addition, I'm using openSUSE 11.4 x64 and KDE. ipython is installed on top of Python 2.7.1 |EPD 7.0-1 (64-bit)

@takluyver
Copy link
Member

When you run it from a terminal, does it complete successfully? Does any message appear at the terminal?

When you run it as an application, what's the working directory (%pwd in IPython)?

@ghost
Copy link
Author

ghost commented May 17, 2011

Yes if I fire up the qtconsole in terminal, it completes fine without any message on the terminal.

In qtconsole application,

%pwd
Out[1]: '/home/joon/documents'

Thank you,
Joon

@takluyver
Copy link
Member

Hmm, nothing obvious there, then. I can't make a launcher for it work properly at the moment, so I can't try to replicate it.

@takluyver
Copy link
Member

OK, I've managed to get a launcher that works, by having the entry point create a PYTHONPATH environment variable. But I can't replicate the problem you're having - %run 'wha<tab> worked for me, with the Terminal parameter of the .desktop file true or false. This is with Ubuntu 11.04, Python 2.7.1

@ghost
Copy link
Author

ghost commented May 18, 2011

When I make it an application, do I have to do something with PYTHONPATH?
Also I will install ipython on top of the python comes with my openSUSE distribution and see if it still happens.

@ghost
Copy link
Author

ghost commented May 18, 2011

Yes. ipython-qtconsole I installed on top of my system python does not show this. It seems it only happens with the one with EPD. Interesting.

@takluyver
Copy link
Member

If you install the dev version of IPython, you shouldn't have to do anything with your PYTHONPATH. I usually use the dev version inside a virtualenv, so the script called by the launcher had to change the PYTHONPATH so it could import the dev version.

@fperez: Do you know of any EPD-on-Linux users who could replicate this? And any way to debug a kernel crash that only occurs when the terminal isn't there to display the traceback?

@minrk
Copy link
Member

minrk commented May 20, 2011

I'm not sure I'm reading this correctly, but are you using current IPython with EPD Python, or the IPython that ships with EPD when you see the problem? If it's the IPython that ships with EPD, this may well be a bug that's been fixed since then.

@ghost
Copy link
Author

ghost commented May 22, 2011

Of course this is IPython 0.11.dev - which I installed on top of EPD with python setup.py install. (After getting rid of older ipython)
And I don't think the version with EPD has qtconsole. :)

@fperez
Copy link
Member

fperez commented May 25, 2011

@takluyver, I don't use EPD on linux, unfortunately. I'm pinging @rkern in case he can get in touch with someone at Enthought who does the linux epd work who could help.

One thing that could be done would be to instrument the code to log everything to a file instead of to stdout. Right now we don't have an easy flag for that, so it would need to be done manually. But replacing sys.stdout/err with an open file object by hand in the kernel should do the trick as a temporary hack, and might provide useful info. @joonpy, if you are willing to play with that and can get any diagnostics, do send them our way. Unfortunately I don't have the time/bandwidth right now to set up an EPD/linux environment to try and replicate this...

@ghost ghost assigned epatters May 25, 2011
@minrk
Copy link
Member

minrk commented Jun 27, 2011

@joonpy - a lot of app code has been rewritten recently, can you check to make sure this still happens with current master?

@ghost
Copy link
Author

ghost commented Jun 27, 2011

Will do. Sorry I have an important exam next Wednesday so I won't be able to test it by then. Anyway thanks!

@minrk
Copy link
Member

minrk commented Jun 27, 2011

I've reproduced this on Ubuntu. I've also had reports of the qtconsole not working when run from pythonw on Windows, which may be related.

My guess is there's something not properly checking for the existence of stdout/err, which are nonexistent or closed in these situations.

@ghost
Copy link
Author

ghost commented Jun 27, 2011

Glad that you were able to reproduce this. :)

@minrk
Copy link
Member

minrk commented Jun 28, 2011

Should be fixed by #542

@minrk minrk closed this as completed in f519f17 Jun 28, 2011
@ghost
Copy link
Author

ghost commented Jul 13, 2011

I just installed the new version and the %run autocompletion worked well. Thanks!

@minrk minrk mentioned this issue Jun 28, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants