Jupyter Notbooks not launching - python

I'm running Python 3.8 (Anaconda) on Windows 10 and have previously not had any issues launching Jupyter Notebooks. Today that changed: When I tried to launch it from the Anaconda Navigator, it suggested that it launched it but didn't open anything in my default browser (Chrome), so nothing really happened. Also, not terminal prompt was launched. When I tried launching it from the command line, typing both jupyter notebook and jupyter-notebook it launches the notbook but only in the background (ie. it provides a link that I need to copy into my browser). I find this quite strange and am trying to understand what's going on. My hunch is that it's some kind of Windows related issue but I'd like to know what issue.
So my question is what can explain this behaviour? And assuming that this is related to some strange Windows issue, I'd be keen to find out what it is.
I replicated the exact steps I used to always launch it (which worked), so this shouldn't be anything to do with the setup.
Cheers!

Related

Jupyter notebooks in VSCode not showing up to date python kernel list

For a couple of months I've had issues with working with virtual envs, python notebooks & jupyter in VSCode, for some reason, a lot of the time, it cannot find kernels I added, even though I can see them when running jupyter kernelspec list. It seems random whether they appear or not. Reloading the screen and restarting vscode does not help, neither does disabling and re-enabling the python and jupyter extensions. I tried both from the button, select kernel and through the command palette. I usually start vscode from the command line, with my virtual environment activated. Moreover, a lot of kernels which I've deleted a long time ago still show up in the list.
Vscode and laptop are both up to date.
I've had issues with the integrated jupyter notebooks before, at first formatting and autocomplete didn't work in the notebook (but they did in regular python files).
I'm on MacOS, if that matters.
Sorry to tell that this is a bug, see bug report:
Can't see or select Jupyter kernel's from Kernel drop-down
And now there's a workaround that:
Find where python is installed
Select the command Python: Select Interpreter
Next select Enter interpreter path
Next enter the path into the input box and hit Enter
This interpretr will now work in VS Code and you might need to re-load
VS Code just once more to get it working in jupyter extension.
Please have a try.

Different Environment of Anaconda Prompt and Jupyter Notebook

I have always been executing my python script through a drag and drop approach to the anaconda prompt as the script is executed in the anaconda environment. I have this script in which it should be executed on another pc through a drag and drop approach in that pc's anaconda prompt. Turns out a certain library wasn't able to be imported. I tried running the script on jupyter notebook in that PC and it works. This would be the first time that I feel that anaconda prompt and jupyter notebook aren't running in the same environment.
Any help would greatly be appreciated, thanks!!
Every time you start you anaconda prompt, if you don't change your enviornment, it will be default in 'base' environment.
And I don't know where your run your jupyternotebook, but you may double check which anaconda environment it is running with.
PS: Since i am still not able to comment. I will write the reply here, hope it helps you a bit.

Arrow up / previous command in VSCode Python Interactive not working

I'm working with VSCode on an Ubuntu 18.04 machine. Everything is fine except that I can't get back to the previous command in Python Interactive Window via Arrow Up. It works in the integrated terminal though, integrated shell is /bin/bash.
I have no idea where this is coming from. I changed "keyboard.dispatch" to "keyCode", but that's not the problem. I also tried different versions of the python-extension.
Do you have any idea?
Thanks!
Not sure if this is helpful for you as an Ubuntu user, but I came across the same problem in Windows this week. In my case, the issue cropped up after I installed the Python extension in VS Code (or at least I didn't notice the issue before this). The combination of using the Python extension, Git Bash for terminal, and python virtual environment killed the up arrow feature for me. Using python outside a virtual environment works fine. My solution was to use Command Prompt as the terminal when I wanted to use a virtual environment interactively.
In my situation, although I delete all the shortcuts of UpArrow, I still can get the previous command through UpArrow in Python interactive. This means there's no way to configure this shortcut, it was built in the plugin which built in Python extension.
So it's some problem with your Python extension, but you said you have tried to install a different version of Python extension but still not work. Make sure you have deleted it completely -> delete the extension folder manually(it's under C:\Users[UserName].vscode\extensions\ms-python.python-xxx).

Spyder(Anaconda) does not start after forced shut down

I stupidly tried to read a massive .bin file in Python, which resulted in the laptop freezing, so I had to force shut down the laptop entirely.
After that, Spyder does not start - I get a 'Spyder crashed during last session' message. I tried reinstalling Anaconda, I tried updating Spyder, I tried resetting Spyder, I tried restarting the laptop. Absolutely nothing works. Qt Console and Powershell open successfully.
Any ideas what else I can try?
For anyone who might encounter this, I solved the problem by following the advice from here:
https://github.com/spyder-ide/spyder/issues/3868
More specifically, I deinstalled Anaconda, cleared the Roaming/.anaconda directory, re-installed Anaconda again, and updated Spyder again using conda update Spyder in the Anaconda Prompt.

Jupyter notebook webpage is a blank screen

So I bought this fancy shmancy Codecademy Pro subscription to take the data science track, but it appears that it has a rather disappointing lack of documentation for part six of its course. I'm learning about Python right now, and I just downloaded the newest version of Miniconda, which included Python 3.7.2. I'm trying to open a .zip file (called Reggie's Linear Regression.zip) using the command
jupyter notebook
and it works, to some extent; it automatically launches a Chrome page, but it's just blank. I get this error in the Chrome console:
Refused to execute script from '<URL>' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
I want it to show this file: Reggie_Linear_Regression_Skeleton.ipynb. It just opens in my notes app when I click on it in file explorer.
I'm very new to Python and downloading libraries and stuff (this is actually my first time), so even just pointing me to other resources that would help me with this problem would be helpful as I don't even know how to describe the issue. Also, I'm 100% sure I've navigated to the correct folder in the Anaconda prompt.
Thanks so much
The latest version seems to be broken, try to downgrade jupyter. If you install with Anaconda the command is:
conda install -c anaconda notebook=5.7.4
Yeah, looks like the latest version is broken. There is already a pull request but it is not yet merged https://github.com/jupyter/notebook/pull/4468. That is a pretty simple fix, so you can also do it yourself for the time being https://github.com/jupyter/notebook/pull/4468/files
I was facing the same issue.
Downgrade jupyter notebook. If you face the blank page againg, after opening jupyter notebook on broswer press "ctrl+f5" to force restart the page.

Categories

Resources