There is a problem when opening Jupyter Notebook - jupyter-notebook

I installed Anaconda 3 in Linux and tried to open Jupyter notebook in browser by typing 'jupyter notebook' in terminal.
But what I've got is the screen I added below.
As I guess, Jupyter Notebook is currently opened via 'Elinks', but I have no idea about what this is.
Do you know how to open Jupyter Notebook in the browser I want, such as Firefox or Chrome?

I wanted to add some information in case you wanted to later access juypter notebook via elinks (or any other text-based web browser in terminal).
I will also go over opening jupyter notebook with Anaconda Navigator.
First, You need to first install Node.js Javascript Runtime Environment by running this command in terminal.
sudo apt-get install node.js
Next, close and reopen terminal (I always do this when installing new software via command line).
When you next try to access your jupyter notebook via elinks it will ask for a token or password.
Option 1 : Token.
Find the token by entering jupyter notebook list in terminal.
Option 2 : Password.
You can create a password for jupyter notebook by entering jupyter notebook password in the terminal.
You can now use the token or your newly created password in order to access jupyter notebook via full-featured text web browser such as elinks.
If you want to access jupyter notebook via Firefox, Chrome, etc. then just use anaconda. This will automatically open jupyter notebook in your standard web browser.
Enter anaconda-navigator in terminal.
Once anaconda navigator opens, simply launch jupyter notebook from the selection.

You can set Firefox or Chrome as default browser, then it should open directly in it.
If it still doesn't, you can always copy the URLs which are displayed when jupyter notebook is started, and paste it in your browser.
To access the notebook, open this file in a browser:
file:///home/harshit/.local/share/jupyter/runtime/nbserver-2985-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=9fc770713dbd755750bbe842896420ecfa7abc038581fc04
or http://127.0.0.1:8888/?token=9fc770713dbd755750bbe842896420ecfa7abc038581fc04
By the way, jupyter notebook doesn't work, because, by default, JS is not enabled in eLinks browser (you can enable it).

Related

Can't run Jupyter notebooks over Anaconda on Mac M1

I have a problem with loading Jupyter notebook from my Anaconda Navigator on M1 Mac. When I try to launch jupyter notebook I get this error :
The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826 "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2508, NSUnderlyingError=0x7fefa8432b50 {Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x7fefa8435de0 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed with error: 153}}}}}
Any idea how to fix this?
I'm an M1 user too. This will not solve the issue, but you can run jupyter notebook on Terminal and it will work even though Jupyter Notebook does not load from Anaconda Navigator. If you want Jupyter Notebook to run in a specific environment, simply type conda activate myenv and once the environment is activated, type in jupyter notebook.
I usually load my jupiter-notebook in vscode, you can give it a try
Also a MacBook M1 user and have run into this problem. Can no longer launch Jupyter Notebook from home screen. Work around on this for me, if you still want to use Anaconda Navigator is to go to the left menu and click on environments, choose the environment and click on the arrow and click on "open with Jupyter Notebook. Ridiculous, but it works.

Issue running jupyter notebook via wls

Installed WSL on Windows 10.
Installed Anaconda according to the Anaconda documentation with the following commands:
bash Anaconda3-2020.02-Linux-x86_64.sh
source ~/.bashrc
You can see the '(base)' in the beginning of each command input line, indicating the conda is activated.
Then I run jupyter notebook by typing:
jupyter notebook
Then I see the following changes as shown in the screen record.
Briefly, the WSL terminal window showed some information very quickly, but is changed to the windows powershell window before you could even tell the information that showed up. I know those information should contain a file and url for opening the jupyter notebook in the web browser. But they flashed out so quickly. Does anyone know why this happens?
Here is a dynamic graph of the Screen record of this issue:
Solved:
1. Wait for a bit more time on the windows cmd and the jupyter notebook running information will show up, where includes the url to open jupyter notebook in the web browser.
OR
Open up another wsl terminal, activate the same environment and type jupyter notebook list, which will show the current running jupyter notebook server. The url is also can be found there.

Unable to start Jupyter lab or Jupyter notebook in a browser

I get the following log when starting Jupyter lab or Jupyter notebook-
[W 17:03:08.963 NotebookApp] No web browser found: could not locate runnable browser.
and Jupyter does not start a browser (or a tab in a browser).
(I am using Linux - Manjaro i3 community edition)
I have configured Jupyter to use google-chrome-stable by
jupyter notebook --generate-config
and setting the following line in ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.browser = '/usr/bin/google-chrome-stable'
(Yes I have uncommented the above line)
/usr/bin/google-chrome-stable and google-chrome-stable successfully launch chrome from the terminal.
I have also tried
jupyter lab --browser=google-chrome-stable
jupyter lab --browser google-chrome-stable
without success.
Jupyter used to open in a browser when I had Pale Moon installed on my system, but now that I have removed it, I cannot seem to get this working. google-chrome-stable is my default browser now.
The obvious workaround is to copy the localhost URL to a web browser but I am trying to avoid that.
Posting dsjamieson's answer here:
You have to give your browser (“google-chrome-stable” in this case) a string format argument (%s) in order to pass it the notebook’s URL:
jupyter lab --browser="google-chrome-stable %s"
or, if you prefer opening chrome in app mode:
jupyter lab --browser="google-chrome-stable --app=%s"
For Jupyter Lab, to make this more permanent:
jupyter-lab --generate-config
Then edit ~/.jupyter/jupyter_lab_config.py and set the ff:
c.ServerApp.browser = 'google-chrome-stable %s'
Or do a variation of double0darbo's answer above.

"Unable to connect to the local runtime" in google colab

I'm trying to connect local run time but it's not connecting,
I used the troubleshooting dialog following commands:
pip install jupyter_http_over_ws
jupyter serverextension enable --py jupyter_http_over_ws
jupyter notebook \ --NotebookApp.allow_origin='https://colab.research.google.com --port=8888 \--NotebookApp.port_retries=0
Have tried the same above steps as said in below URL
https://research.google.com/colaboratory/local-runtimes.html
Facing an issue 'Jupyter authentication cookie was not detected'
Tried by disabling adblocker, antivirus and also using different port numbers. Below was the solution given by team
Navigate to http://localhost:8888 in a separate browser tab and follow the provided instructions. This will set a browser cookie used for authentication between the browser and the Jupyter notebook server.
But when I open the URL, it asks for a password(already set up) and then no further instructions are appearing.
This issue was raised in Github issues for Collaboratory:
This answer helped me https://github.com/googlecolab/jupyter_http_over_ws/issues/1#issuecomment-557469128
According to this issue
start the jupyter notebook with the below command.
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --NotebookApp.port_retries=0 --notebook-dir="" --no-browser --allow-root --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True --port=8888
then open the notebook by going to this URL.
localhost:8888
according to kris This may allow you to connect, but it basically disables all security features.
Then retry connecting to local runtime with Google Colab
If it does not solve your problem then try disabling AdBlock extension or app.
For Windows (10/11)
Method 1: Using git bash
follow these steps
https://research.google.com/colaboratory/local-runtimes.html
Method 2: Using Windows terminal & Multiline commands
Install jupyter_http_over_ws
pip install jupyter_http_over_ws
enable the jupyter_http_over_ws jupyter extension (one-time)
jupyter serverextension enable --py jupyter_http_over_ws
Use multiline commands to start server and authenticate
jupyter notebook ^
--NotebookApp.allow_origin='https://colab.research.google.com' ^
--port=8888 ^
--NotebookApp.port_retries=0
Method 3: Using single-line command & windows terminal
Install jupyter_http_over_ws
pip install jupyter_http_over_ws
enable the jupyter_http_over_ws jupyter extension (one-time)
jupyter serverextension enable --py jupyter_http_over_ws
Use single-line commands to start server and authenticate
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0
Once the server has started, it will print a message with the initial backend URL used for authentication. Make a copy of this URL as you'll need to provide this in the next step.
Connect to the local runtime
In Colaboratory, click the "Connect" button and select "Connect to local runtime...". Enter the URL from the previous step in the dialog that appears and click the "Connect" button. After this, you should now be connected to your local runtime.
There are several reasons why a local connection might fail. To gather more diagnosis information, click the 'troubleshoot' link in the notification that appears in the lower left of the screen.
It will look like this:
I'd recommend following whatever steps are recommended there. If you get stuck, please update your original question with the diagnosis offered in the troubleshooting dialog.

Problems running Jupyter Notebook

I've just installed Jupyter Notebook so I can follow the Udemy Python Bootcamp course.
I already had a fully working install of Python 3.71 and Pycharm and then installed Jupyter Notebook with:
pip install jupyter
This was successful other than messages about the some files not being in the PATH environment variable. I manually added the folder to PATH.
I have run Jupyter Notebook at the command prompt with:
jupyter notebook
So far so good - Jupyter Notebook home screen appears in my browser with all the expected folders, Documents, Desktop etc listed.
However if I try and left click on one to see its contents then it pauses for a few seconds and just displays the following (not very descriptive) error:
Server error: error
The error as a screen shot:
I'm absolutely stuck and can't progress my course without Jupyter Notebook.
I'm running Windows 7 Home Premium 64 bit
Firefox (Quantum 64.0)
Bitdefender Internet Security 2018
You can try
pip install --upgrade jupyterhub
I solved the problem using this command.

Resources