Before I've installed python 3.6 and update all (conda update --all) my Jupyter Notebook just stopped to works. When I launch it, just an empty browser page appears. I tried all solutions that I found, but they don't work. I have deleted %USERBLABLA%, clear cache and cookies, uninstall and install it again and it still doesn't work. Browser console prints this errors:
Refused to execute script from '<URL>' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled
Uncaught ReferenceError: require is not defined
at VM17 tree:24
You should check the version of Notebook on Anaconda Navigator.
If it's 5.7.6 then you should downgrade the notebook's version to 5.7.4 by using the Anaconda Navigator.
Related
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.
I was able to use jupyter notebook 4 days ago. The only thing that changed was there was a firefox version update.
After that the server crashes everytime .ipynb files are opened. Even the directory will have a server error. I tried it both on Firefox and Google Chrome, both browsers will crash the server.
My only kernel is python3 and it always says "Kernel Busy". I tried resetting my pc and the jupyter notebook, but nothing seems to work.
The console showed:
The last 2 lines are causing the crash but I don't know how to fix it
When I type conda install jupyter in the anaconda prompt, I get something before it finishes as shown below. Maybe it might have a cause as to why it is having issues:
I created a new python environment and installed python, matplotlib, pandas, jupyter and it still crashes
Please uninstall and re-install all the below items:
ipykernel
ipython
jupyter_client
jupyter_core
traitlets
ipython_genutils
Additionally, if you're going to install with conda, follow below command.
run conda clean -tipsy
This command will clean up conda caches before you start.
Reference:
https://github.com/jupyter/notebook/issues/1892
Do you let Jupyter start the browser? If so, disable that and start the browser manually. I don't see how the zmq error messages could be related to the browser startup, but since you say that the only change was a browser update, that's worth a shot.
Check which version of pyzmq is installed. If Jupyter Notebook and the kernel are in different conda envs, check both and make sure they are on the same version and build. Try upgrading or downgrading to different versions. According to Anaconda issue 8932, there are problems with pyzmq on Windows. And a new build for win32 was released about two weeks ago - though I would expect win64 builds to be used nowadays.
I also found some recommendations for a similar error message to yours in Spyder issue 6097. The first one is to try without firewall and/or antivirus. You might have picked up a new firewall rule unknowingly. Trying different versions of pyzmq is also mentioned there.
I am sharing this solution in case someone needs it in the future.
I have just faced the same problem a hour ago. This was the message I was getting in the terminal. And the jupyter keeps restarting.
ModuleNotFoundError: No module named 'html.entities'; 'html' is not a package
[I 00:44:32.436 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
After Searching through the internet when I can not find the solution. I fixed it by removing the .HTML files I had in the directory. After moving those file jupyter started working parfectly.
I just had a similar problem - for me, it was casued by a non-existing %temp% directory (I have %temp% mapped to a ram disk, and the temp folder on it wasn't created yet).
Creating the folder pointed to by %temp% solved the issue.
All my environments were working totally fine but suddenly after restarting the system, the jupyter notebook from an environment was not opening or it was suddenly crashing. Tried form anaconda prompt but getting "Unable to create Process...
All my DL dependencies were on this environment and I didn't want to create new environment completely installing all the required dependencies.
Solution: I opened the Anaconda Navigator and cloned old_env to new_env and it worked magically. I could able to open the jupyter notebook successfully and all dependencies were working fine. Hope it helps
My environment:
Windows 10 Professional
Python 3.7.2
virtualenv 16.4.3
I created a new virtual environment with D:\Python37\Scripts\virualenv env
Then I activated the virtual environment with env\Scripts\activate
Then I installed jupyter with pip install --upgrade jupyter
Finally, I started jupyter with jupyter notebook
Everything starts up fine, and I create a new Python 3 notebook. Unfortunately, the notebook never connects to the server. I get the following error message in powershell
Replacing stale connection: (token)
In the browser, I get the following error message:
"A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration."
My two prior virtual environments (with Jupyter) work fine. I've deleted .ipython, .jupyter, AppData\Roaming\jupyter, without any luck.
I've cleared cookies from my browser and have tried a different browser. Nothing works.
I've created two other virtual environments before, and both of those still work.
All jupyter notebooks in the two working environments start up as untrusted, whereas the new environment starts up as trusted. I'm guessing that I clicked on something and now the notebook is looking to start up in a trusted fashion - which may require HTTPS.
Where do I look to fix this problem?
This appears to be a tornado issue. I found clues here.
Jupyter no connection to server
Jupyter kernel not connecting
I looked at the version of tornado (from the above links) in an environment that was working. It turns out that the version was 5.1.1.
I looked at the version of tornado in an environment that was NOT working. It turns out that the version was 6.0.
I downgraded the version of tornado in my non-working environment to 5.1.1 with the following command.
pip install --upgrade tornado==5.1.1
And now the non-working environment works!
Anaconda is pretty good at handling any dependencies.I just tried this using Anaconda in the terminal:
# see current envs
conda info -e
# make new environment, feel free to add your version of python with python=3.7 handle
conda create -n test
activate test
conda list #This should appear empty
conda install jupyter #y to install everything.
jupyter notebook #launch jupyter notebook
Mine comes up as 'trusted'. The method above may not necessarily be the most minimalist way of doing things, but at least nothing breaks and you're up in running in no time. I'm using conda version: 4.6.2
Since this is one of the top answers to a Google search on the error :
"A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration."
This might also have nothing to do with any install or library.
It may just be a proxy setting in your browser or on your system directly.
One solution may be to deactivate the proxy or add an exception to Jupyter's URI.
In my case, the situation was different. It was a browser caching issue, i.e., I would call jupyter-lab using a batch script and it would just open a tab. Closing all explicitly tabs and then the browser worked me.
If there was an old instance of another disconnected jupyter-lab, it would somehow not establish a proper connection.
This solution work for me :
pip uninstall Pyzmq
pip install Pyzmq==19.0.2
Using pip to install some packages resulted in confusing the jupyter installation. So you can uninstall the packages installed with pip, disable the jupyter_contrib_nbextensions, then try to use conda install as possible.
jupyter labextension disable my-extension
I installed Anaconda 3.7 on Ubuntu 18.04 (Bionic Beaver). Installation was successful. When I tried to start Jupyter Notebook from navigator it throws the following error.
Access to the file was denied The file at
file:///run/user/1000/jupyter/nbserver-26395-open.html is not
readable. It may have been removed, moved or file permissions may be
preventing access.
For me, this worked on Raspberry Pi4, Ubuntu 20.04, with Chromium Browser.
Generate the config file with following command.
jupyter notebook --generate-config
Config file is created at ~/.jupyter directory
Look for parameter c.NotebookApp.use_redirect_file and set the same as False.
c.NotebookApp.use_redirect_file = False in order to disable launching browser by redirect file .
Explanation:
For versions of notebook > 5.7.2, a security feature measure was added
that prevented the authentication token used to launch the browser
from being visible. This feature makes it difficult for other users on
a multi-user system from running code in your Jupyter session as you.
However, some environments (like Windows Subsystem for Linux (WSL) and
Chromebooks), launching a browser using a redirect file can lead the
browser failing to load. This is because of the difference in file
structures/paths between the runtime and the browser.
Also make sure the ~/.local/share/jupyter and ~/.jupyter directories are owned by the user running jupyter
I think you have changed your default browser from Firefox to something else, Jupyter Notebook works fine on Firefox but throws permission denied on Chromium (for me). Just go to Setting > Details > Default Application and select FireFox in Web. Cheers
As shown in the image, jupyter notebook also provides a link. Try opening it with the browser of your choice. It worked for me...
With recent versions of snap, applications installed with snap can't by default open files in hidden folders (with a name starting by .).
In Ubuntu 20.04, chromium is installed with snap (even when using the command sudo apt install chromium-browser), so chromium can't open the html file used by Jupyter.
As stated by #rahul-sood, a simple workaround is to copy-paste one of the alternative links given by Jupyter in the terminal (starting by http://localhost:8889/?token= or http://127.0.0.1:8889/?token=).
For anyone interested in open jupyterlab or jupyter notebook in chrome : install it in the terminal with
sudo apt-get install google-chrome-stable
It didn't work for me by using chromium. And, as mentionned paugier, in Ubuntu 20.04, chromium is installed with snap (even when using the command sudo apt install chromium-browser), so chromium can't open the html file used by Jupyter. So if you install chrome by using the terminal it works.
Open Chrome and paste the Jupiter file path. In my case it's file:///home/vanx/.local/share/jupyter/runtime/nbserver-14511-open.html and it worked.
I recently installed the Anaconda Navigator (Anaconda 2) on a Windows 8.1 machine.
If I launch Jupyter Notebook from the Anaconda window, I am met with a 'Page cannot be displayed' error in my browser (Chrome).
I have tried launching Jupyter Notebook from the Anaconda Prompt (no notable error message output). I have also tried opening the Notebook in a different browser (Firefox), and I have tried running the Prompt in Administrator mode. No luck.
I have Jupyter Notebook version 5.6.0 according to the Navigator, but if I type jupyter --version at the prompt it says 4.4.0 (wondering if this is a problem?)
I kind of expected to be able to launch a Notebook right off the bat after installing Anaconda. Is there some set-up I have missed?
(Edit) Tried a few more things, after reading the Jupyter Notebook docs. Tried replacing 'localhost' in the URL with 127.0.0.1, and tried opening the link Chrome with --disable-web-security. Didn't help.
Steps which i will advice:
1) Open your command prompt in the directory which contains your notebook or where you want to create new notebook.
2) Write jupyter notebook in cmd and press enter.
If jupyter notebook is properly installed then it will certainly open, else try reinstalling it.
Note: You can always update your jupyter notebook via conda or pip. At time if you update or install package/IDE via pip, Anaconda terms it as "broken link" and give issue.