Spyder 5.3.2 and 5.3.3 silently crash on startup - python

I'm using pip rather than conda to manage Spyder and all my python packages. I've found that in the last couple of spyder releases, trying to run spyder in the console results in my mouse cursor changing to the "working" cursor for a split second, then the command executes with no output and I'm on to the next line in the console. The Spyder window never appears. Version 5.3.1 works as expected, however. I've tried updating all my packages through pip but haven't had any success. Does anyone know what I can do to further troubleshoot this? I'm at a loss, since I'm not even getting an error message.

Related

How do I update Spyder when terminal command results in "All requested packages already installed"?

I've been trying to update Spyder, which is currently version 4.0.1. I first updated Anaconda using
conda update anaconda
which updated Anaconda to version 4.9.0. I then tried to update Spyder with the following
conda update spyder
but this resulted in "All requested packages already installed." and the version remained 4.0.1. I tried updating through the Anaconda Navigator GUI, but when I click the gear icon on Spyder, it shows https://i.imgur.com/xyKgQEY.png with "Update application" grayed out.
Every time I open Spyder, it tells me that version 4.1.15 exists, but I'm not really sure what to do.
Edit: answer is below in the comments. Of note, I may have tried the direct install command before but wrote 4.1.15 instead of 4.1.5 because I misread the latest version number.

Python command prompt very slow to appear (Anaconda)

I've lately noticed an increasing lag when I fire up the CMD window to run python.
Immediately after entering "python", I see the python version info, but instead of the command prompt (>>>) I just get a blinking cursor (not showing in screenshot). After what's now become a couple of minutes, the command prompt finally appears, and I can run python code as usual.
When this happens, the CPU on my little work laptop is clearly under heavy load, the fan goes way up.
I have basically the same setup on my home PC (still with the older Anaconda and python 3.7) and never had any problems like this.
I was running python 3.7 in Anaconda on Windows 10. I just do simple scripts, copy and paste the code in a terminal window. In my original version, I had the base env + one clone, both had this problem.
I tried updating conda and anaconda but nothing changed. I thought it might be some dependency conflicts (I had recently pip-installed a couple of heavy-ish packages into my clone env: pytessearct and openpyxl), so I finally uninstalled Anaconda and reinstalled the latest version (Anaconda3-2020.07-Windows-x86_64 with python 3.8) with the standard packages, and I still have the same problem.
One related clue: Anaconda Navigator was also hecka slow to load. I tried disabling SSL verification per this thread (Anaconda navigator VERY slow) but it had no effect on the time delay for the python command prompt. But with the fresh install, Navigator now loads normally.
In my new install, I did the same setup, base + clone, both with the standard Anaconda package set, no add-ons, I still have the same problem in both envs.

"r.start is not a function" Fermipy Conda Error

I've been using the Fermipy conda environment on Python 2.7.14 64-bit on macOS Catalina 10.15.5 and overnight received the error "r.start is not a function" when trying to connect to the Jyputer server through Vscode (if I try on Jupyter Notebook/Lab the server instantly dies). I had a bunch of clutter on my system so I ended up formatting it and reinstalling all the dependencies needed (such as Conda through Homebrew, Fermitools through Conda and Fermipy through the install script on their site), but still get the same error, although I was previously running python scripts just fine. It gives me no other error or output, if it did I would attach it here. This is the error I get.
Edit: I get the same error using any version of Python 2.7.XX and not for python 3.7.XX.
As answered here, https://github.com/microsoft/vscode-python/issues/12355#issuecomment-652515770
VSCode changed how it launches jupyter kernels, and the new method is incompatible with python 2.7.
Add this line to your VSCode settings.json file and restart.
"python.experiments.optOutFrom": ["LocalZMQKernel - experiment"]
I got the same message. (r.start is not a function.) I had an old uninstalled version of anaconda on the computer which had left behind a folder containing its python version. Jupyter was supposed to be running from new venv after setting both python and jupyter path in vscode. I fully deleted remaining files from old anaconda install - message went away and notebook ran fine. Maybe try getting rid of all conda stuff and pip install jupyter and anything else you need.

Anaconda after update: Command propmpt responding very slowly and IPython not loading

I ran the conda update --all command, but unfortunately something went wrong with the update process and windows crashed. Now if I try to redo the update the terminal is responding very slowly, to the point where installing the update is impossible. Even worse I ran conda update ipython, which also executed very slowly and now the ipython console no longer works reporting: ImportError: No module named 'IPython.kernel.zmq.kernelapp'.
I tried to update anaconda as I recived the error: line magic function %pyomo not found, when executing one of the basic examples using pyomo.
What should be done to restore anaconda? I am using the Spyder IDE.

Jupyter notebook not running code. Stuck on In [*]

My code was running fine before I did not change anything and I ran it again. Now it doesn't return anything not even an error. It is just stuck on "In [*]".
This means that Jupyter is still running the kernel. It is possible that you are running an infinite loop within the kernel and that is why it can't complete the execution.
Try manually stopping the kernel by pressing the stop button at the top. If that doesn't work, interrupt it and restart it by going to the "Kernel" menu. This should disconnect it.
Otherwise, I would recommend closing and reopening the notebook. The problem may also be with your code.
updating ipykernel did it for me. it seems arch linux's ipykernel package had been outdated for some time
just do pip install --upgrade ipykernel
reference here: github solution
I have installed jupyter with command pip3 install jupyter and have the same problem. when instead I used the command pip3 install jupyter ipython the problem was fixed.
pip install ipykernel --upgrade
https://github.com/jupyter/notebook/issues/1133
I had the same problem and not any of the above mentioned solutions worked.
Until I updated conda packages:
conda update conda
conda update anaconda
and ... Voila! It all works!
The answers that state that your kernel is still executing the code in the cell are correct. You can see that by the small circle in the top right. If it is filled with a black/grey color, then it means it is still running.
I just want to add that I experienced a problem in JupyterHub where the code in the cell would just not execute. I stopped and restarted the kernel, shutdown and reloaded the notebook, but it still did not run.
What worked for me was literally copy pasting the same code to a new cell and deleting the old one. It then ran from the new cell.
This is mean your program is still running in background, you need to click shutdown (Shown in attached Image).
*** Shutdown the Running cell and again run your program.
I fixed this issue
just only type this command: jupyter notebook --no-browser
It will show you the path then copy and paste on Jupyter Notebook browser
The code will be executed in IPython Notebook Python 3
Usually, stopping and restarting that particular cell fixes this issue.
I had the same issue now:
Solved it by:
Just reloading the local weblink in which the Python is running
http://localhost:8888/notebooks/sec%201/Untitled.ipynb
Upgrading ipykernel, notebook and then downgrading tornado to 4.2.0 solved the issue for me.
My current package versions related to jupyter:
jupyter==1.0.0
jupyter-client==5.2.2
jupyter-console==6.1.0
jupyter-core==4.4.0
jupyterlab==2.2.5
jupyterlab-server==1.2.0
ipykernel==5.3.4
notebook==5.2.2
tornado==4.2
pyparsing==2.4.2
ipython==5.5.0
ipython-genutils==0.2.0
prompt-toolkit==1.0.15
Github
I had the same issue. I found that ipython must be running for jupyter notebook to execute.
Do the following:
Go to the folder where you have your ipython notebook(.ipynb)
Press shift and right click on the empty space then select "open command window here". This will open a command prompt window.
Type ipython. This will start ipython.
Open another command prompt window and open jupyter notebook.
Open your file again and go to cell>>>run cell.
This should work. It worked for me. Cheers!
This is because when we run a loop until it's termination the Kernel is in busy state and so IN [*] is shown up. Since Kernel is busy and if we just leave that cell to execute completely and switch to another cell to run, the corresponding cell will get busy and so again for that cell IN[*] is shown.
In that case you just need to restart your jupyter notebook and all is fine then.
But be sure that your loop will terminate this time or else again this error will turn up.
I have uninstalled jupyter, notebook and ipython, and installed jupyterlab. It is working for now (with just a few libraries installed and Python 3.6.8.
Something to discard: Uninstalling Python 3.7 completely with his libraries and reverting to 3.6 doesn't fix it, although it improves it, it works intermittently now (but once sth doesn't work properly, things start to get worse and worse, so I did the above).
Check the output on the server environment from which jupyter notebook was launched if you can. You'll probably find error messages and print() results.
Anaconda environments might cause this. I had to deactivate all conda environments and launch the notebook from root.
conda deactivate
To do so, cd into the directory in your terminal, run conda deactivate until there is nothing in the parantheses that precede your computer name and username. In the example below, I had to run conda deactivate twice.
(base) Your-Computer:~ Your-Username$ conda deactivate
(/Users/jw1/opt/anaconda3) Your-Computer:~ Your-Username$ conda deactivate
Your-Computer:~ Your-Username$ jupyter notebook
Then I was able to run jupyter notebook, and the code ran as expected.
I have also faced this problem number of times. I simply click the small square button (interrupt the kernel) beside Run button and click on Restart the kernel(with dialog) button (just beside square box) to run my program when struck on in [*].
The reason why it is happening is you are still talking to the same kernel instance in the second run, the variables from first run still exist and haven't been cleared.
This can be solved by adding this command before each run
%reset -f

Categories