Spyder 4 Ipython console automatically restarts kernel after each execution - ipython

I have recently update my spyder 4 to the latest version.
I execute a code and at the end of each execution the current Ipython console where my code has just executed, automatically erase all the variable explorer and restarts the kernel.
Even when I try to stop the code at some point for debugging, it ignores me being in the debugging mode and keeps on restarting the kernel!
How can I control this behavior?
Thanks for your comments in advance

Related

Visual Studio Code Terminal Exits Immediately

When I open the terminal in VS Code, the terminal opens for about half a second, crashes, and outputs this message:
The terminal process "/bin/zsh '-l, '" terminated with exit code: 1.
What could possibly be the cause of this problem. and how do I fix it? I'm using a Mac.
You would want to check your user settings first. Review terminal.integrated settings that could affect the launch.
You're using a Mac, so on macOS, go to Code > Preferences > Settings. In the settings, you may want to search for this:
Just in case you modified settings.json without knowing, you could by typing in #modified or accessing it by Filter Settings (top right) > Modified.
If you did not modified anything, then it may be due to these:
Test your shell directly. Try running your designated integrated terminal shell outside VS Code from an external terminal or command prompt. Some terminal launch failures may be due to your shell installation and are not specific to VS Code. The exit codes displayed come from the shell and you may be able to diagnose shell issues by searching on the internet for the specific shell and exit code.
Use the most recent version of VS Code. Each VS Code monthly release has many updates and fixes and may include integrated terminal improvements. You can check your VS Code version via Help > About (on macOS Code > About Visual Studio Code). To find the latest version of VS Code, go to the VS Code release notes. You may also want to check that you have installed the latest version of your shell.
Use the most recent version of your shell. If your shell is installed separate from your platform, try installing the latest available version of the shell. The same advice applies if you are on an older build of your operating system. For example, some older versions of Windows 10 did not work well with the VS Code terminal.
Enable trace logging. You can enable trace logging and capture a log when launching the terminal. Logging often reveals what is wrong as all arguments used to create the terminal process/pty are recorded. Bad shell names, arguments, or environment variables can cause the terminal to not launch. Keep this log for later if your problem isn't solved.
Exit codes and shells
Search for the specific shells or exit codes in Google (if provided), maybe it would help.
If these still did not help, you may consider searching it in Google (mainly Stackoverflow or github).
Reference link: https://code.visualstudio.com/docs/supporting/troubleshoot-terminal-launch

VSCode hangs when trying to run a Jupyter notebook?

I am trying to run a Jupyter notebook in VSCode. I have successfully run notebooks in the past, but something has happened to make VSCode "hang" when I try running. When I hit run, the terminal shows the file location and the location of python.exe as expected (shown in the first image, with some personal information redacted), but nothing ever happens. The code never completes and the cells never output. I get a small "pending" icon of a clock and an arrow (shown in the second image) to tell me a cell is running, but even the most basic "Hello, world" never completes or gives an error. I have no trouble running regular python files, and if I export an ipynb to py I can run it, but I cannot run the ipynb itself. Trying to restart the Jupyter kernel also seems to hang, never completing and never crashing or erroring. The only clue I really have is that when I hit F5 to run, there's no python version showing in the bottom left corner, the way there is when I run py files (third image is while trying to run ipynb and fourth image is while successfully running py).
I have tried uninstalling and reinstalling the Jupyter extension from VSCode and restarting VSCode between every step. I have tried swapping between python.exe and conda.exe in the terminal settings python.condapath. I have checked that the windows terminal is cmd. I've tried creating new notebooks in VSCode that only have print("Hello, world"). I have tried the command "Select interpreter to start Jupyter server" and selected the correct version of Python, but nothing has changed any time I've tried to run.
I am using Anaconda version 4.10.3, VSCode 1.61.2, IPython version 7.9.0, and Jupyter notebook version 6.4.3.

Python IDLE refuse to launch

Python Idle recently straight up refuse to launch, launching it from start menu or its own folder does nothing. Repairing and reinstalling does nothing, nor does running it in older versions of windows does anything.
No changes were made to the program before this. It could be due to a windows update but highly doubted it.
normally, I would get error messages or something. But nothing this time, it doesn't even show up in task manager.
Try deleting the idlerc folder in your profile directory.
This should fix the problem
Example folder directory:
C:\Users\your-username

Is it possible to resume operation after pausing in jupyter

Is it possible to pause the operation of jupyter while performing a computational intense task freeing the cpu and resume it later.
I realize this is very outdated, but I found a solution to this problem after searching for quite a while! I actually ended up trying a bunch of random combinations.
CTRL+S worked for me when using jupyter notebook with Anaconda.
You must be in the shell for this to work.
Also, other key combinations that didn't work for me but were suggested elsewhere include:
CTRL+Z
and
CTRL+I
Hopefully this can at least help out someone down the line...
In current Jupyter no such option. But you can try system tools
In case of Task manager in Windows:
Identify running process with name python.exe
Set low priority of the process with a click in popup menu
For more control try "Process Explorer".
It can Suspend command for the tree of processes.
Also see https://www.reddit.com/r/Python/comments/1spmpt/pause_a_running_python_script_and_resume_when/ for further tricks On Linux or Mac.
A solution that should work on a Mac or Linux (perhaps Winders too, but your mileage may vary). There should be a terminal window running Jupyter. Navigate to that terminal window and press Control-Z. It will suspend the job and put it in the background.
:
:
[I 13:24:05.147 NotebookApp] Saving file at /seisbench/examples/createGEOFON.ipynb
[I 13:25:04.858 NotebookApp] Saving file at /seisbench/examples/createGEOFON.ipynb
^Z
[1]+ Stopped jupyter notebook
To restart, type 'fg' in the terminal window to bring the job to the foreground. You could probably do a 'bg' to put it in the background too, but I did not test this.
(bds) LC02WR133HV2R:notebooks a0194920$ fg
jupyter notebook
[I 13:27:05.231 NotebookApp] Saving file at /seisbench/examples/createGEOFON.ipynb
:
During the time the application was stopped, all the Jupyter notebooks stopped updating. Once the application was placed back in the foreground, all the Jupyter windows continued where they left off. Good luck.

pydev remote debugging blocks when running to completion

I'm following these instructions to remotely debug a python script http://pydev.org/manual_adv_remote_debugger.html
Using breakpoints and stepping work without a problem, but after resuming the script (without any other further breakpoints) the script executes the remaining instructions, and then hangs instead of exiting normally. Even closing the server from pydev does not help, I have to Ctrl+Break the script
I am sure I've done this a while ago with an older eclipse+pydev, and the script resumed and exited normally (and it's very important for me not to mess the rest of the execution).
I've tried this with both Eclipse Luna and Liclipse pydev_4.0.0.201504132356, pydev_4.0.0.201504092214 on Windows 7 x64, same behaviour
Is this an intended behavior or a bug? How could I make pydev let the script end normally?
I can't reproduce this here... please report that as a bug adding details on how to reproduce it (i.e.: ideally, create a project on github and add a step-by-step on how to reproduce it so that it can be fixed... without being able to reproduce it properly, it may be pretty hard to fix).
Also, please give details on the OS and Python version used in the report (https://sw-brainwy.rhcloud.com/tracker/PyDev/)