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

Problems with the IPython console #5596

Closed
kklmn opened this issue Oct 28, 2017 · 5 comments
Closed

Problems with the IPython console #5596

kklmn opened this issue Oct 28, 2017 · 5 comments

Comments

@kklmn
Copy link

kklmn commented Oct 28, 2017

Hello,

Spyder is a great IDE. ...Well, it was, before the internal console had been removed. Since then it has been a constant fight with the IPython console and a continuous hope it will be solved. This issue I have on all my computers, in Python 2 and 3, and in WinPython and (especially) in Anaconda.

  1. The kernel is constantly dying. After a few, frequently just one, restarts of a script the kernel is hanged. I spend a few long seconds until I realize it is hanging and a few long seconds for closing the tab. The start of a new kernel is also not fast. Having it repeated a few tens times a day makes me quite angry. I saw the comments about this issue and the answers that this was not Spyder's problem. Fine, but you know that the problem exists. Why the simple console was removed while being a perfect tool for many?

  2. The Spyder's IPython console is not a friend of multiprocessing. Try this simple example.

**********************
from multiprocessing import Pool

def f(x):
    return x*x

if __name__ == '__main__':
    print("aaa")
#    __spec__ = None
    with Pool(5) as p:
        print(p.map(f, [1, 2, 3]))
**********************

It perfectly runs in an external console and doesn't in Spyder's IPython. The problem sits in sitecustomize.
Uncomment that line before Pool to make it work. To cure a big project is much harder -- and this is not a problem of that project, actually.

  1. I liked and used the elapsed time clock in the old console; it has gone.

Is there way to return the old console or to opt for a smaller subset of the IPython console that would simply work?

Thanks!
Konstantin

@ccordoba12
Copy link
Member

ccordoba12 commented Oct 28, 2017

My answers:

The kernel is constantly dying

Please give us a clear way to reproduce this problem. Simply saying this is not useful.

The start of a new kernel is also not fast.

Quite true. We do a lot of stuff when starting a new kernel, that's why it takes so much time:

https://github.com/spyder-ide/spyder/blob/3.x/spyder/utils/ipython/start_kernel.py

Instead of restarting consoles, you should simply reset their namespaces. It's basically equivalent.

Why the simple console was removed while being a perfect tool for many?

It wasn't. Please see issue #4524 for our reasons to do it.

The Spyder's IPython console is not a friend of multiprocessing

Also true. Sorry, but this is a problem between multiprocessing and the Jupyter architecture, not really a Spyder problem, so we can't do anything about it.

I liked and used the elapsed time clock in the old console; it has gone.

You're welcome to send us a pull request to implement that feature for the IPython console. It consumed a lot of CPU though, so you would need to fix that.

Is there way to return the old console

No, and it's not going to come back, sorry.

or to opt for a smaller subset of the IPython console that would simply work?

The IPython console is working for most people.

@kklmn
Copy link
Author

kklmn commented Oct 29, 2017

The IPython console is working for most people.

I've now extensively played with Spyder on Ubuntu and must say it works nicely. Respect!

But I also conclude that you, developer(s), don't go to touch Windows very often. And here is the contradiction: you've turned your development towards newbies in Python (otherwise I can't explain all this love to IPython), but most of newbies sit in Windows, I believe, and I doubt you've tested the Spyder's IPython console in Windows for a whole single day (well, if you don't test Hello World scripts). And you may disbelieve me but it is much much worse there in Windows.

I wish you good luck in making Spyder in Windows great again.
Konstantin

@kklmn kklmn changed the title IPython console kills the project IPython console kills the project of Spyder Oct 29, 2017
@ccordoba12
Copy link
Member

ccordoba12 commented Oct 30, 2017

you've turned your development towards newbies in Python (otherwise I can't explain all this love to IPython), but most of newbies sit in Windows, I believe, and I doubt you've tested the Spyder's IPython console in Windows for a whole single day

Could you let us know how it's failing for you? I'm developing one of my papers on Windows, and I haven't found any serious problem while doing it. Most probably the issues you're seeing are generated by your firewall/antivirus, which is forbidding sockets communication in your PC.

Besides, please read carefully the reasons I posted on issue #4524: we had to remove the Python console because it was broken on Windows and we didn't know how to fix it.

Finally, we didn't remove the Python console because we love IPython, but because the IPython/Jupyter architecture is far more robust, well documented and widely used than the Python console one. That architecture was quite similar but not developed by us, but by Spyder's original author, which (unfortunately) retired from the project several years ago.

@ccordoba12 ccordoba12 changed the title IPython console kills the project of Spyder Problems with the IPython console Oct 30, 2017
@ccordoba12
Copy link
Member

Closing because of lack of response.

@Krisanu029
Copy link

An error ocurred while starting the kernel
The error is:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in enter
return next(self.gen)
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\Users\KRISANU\AppData\Roaming\jupyter\runtime\kernel�a74baec9e.json'

please help me to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants