Running Tensorboard on same port as jupyter lab - jupyter

This is running jupyter and tensorboard on same port.
I want to do same for jupyter lab, but I am unable to understand how to run both on same port.
Running tensorboard :
tensorboard --logdir={path to eventfile} --port={port number}

Related

jupyter notebook not launching from the anaconda command prompt

(base) C:\Users\kpl16587.KPLC>d:
(base) D:>jupyter notebook
[I 13:47:49.286 NotebookApp] The port 8888 is already in use, trying another port.
[I 13:47:49.289 NotebookApp] The port 8889 is already in use, trying another port.
[I 13:47:49.291 NotebookApp] The port 8890 is already in use, trying another port.
I reinstalled Jupyter since i could not launch and now i get the above error.
Please assist.
Figured it out, by modifying C:\Users\username.jupyter\jupyter_notebook_config.py
line---#c.NotebookApp.browser = ''
to
---#c.NotebookApp.browser =u'C:/Home/AppData/Local/Google/Chrome/Application/chrome.exe %s'
Now Jupyter notebook launching perfectly.

Google colab local environment - Error connecting to mongodb running locally

I have successfully connected to local environment on Jupyter notebook on port 8888. Now I am trying to query locally running mongodb on port 3001. I am using pymongo and below is my code:
myclient = pymongo.MongoClient("mongodb://localhost:3001")
mydb = myclient["meteor"]
mydoc = mydb["historicalNames"].find({ "Name" : "John Doe"})
print(mydoc)
<pymongo.cursor.Cursor at 0x7f78ff706e80>
But when I try to fetch data using below code
df = pd.DataFrame(list(mydoc))
df.head()
I get the error:
ServerSelectionTimeoutError: localhost:3001: [Errno 111] Connection refused
How to connect to local DB with connect local environment from google colab
You might try simplifying your setup by removing colab: does the same notebook code work on your local jupyter installation using the jupyter front-end?
A total guess: is the jupyter runtime running inside a docker container different to where the mongodb server is running? If yes then you probably need to bridge networks to make it work, or tell both docker containers to use --net=host networking (and make sure there are no port collisions among your host & all docker containers).

Unable to start jupyter

When i try to run jupyter it shows me this error :-
ERROR: the notebook server could not be started because no available port could be found.
Terminal Logs are as follows:-
[I 20:52:08.747 NotebookApp] The port 8888 is already in use, trying another random port.
[I 20:52:08.748 NotebookApp] The port 8889 is already in use, trying another random port.
[I 20:52:08.748 NotebookApp] The port 8890 is already in use, trying another random port.
[I 20:52:08.749 NotebookApp] The port 8891 is already in use, trying another random port.
[I 20:52:08.750 NotebookApp] The port 8892 is already in use, trying another random port.
[I 20:52:08.750 NotebookApp] The port 8988 is already in use, trying another random port.
[C 20:52:08.779 NotebookApp] ERROR: the notebook server could not be started because no available port could be found.
And, I also checked my system to check which process is running on that port and I found that no process is running and none of these ports are used by any process. But, I still get that error.
I also changed a default port of jupyter to various other port, but still get the same error.
I faced the same problem then run with
jupyter notebook --port 9999
This work for me jupyter notebook stop 8888 or
jupyter notebook --ip=0.0.0.0 --port=8888
I found solution here
I know it sounds silly, but I've just run into this problem and restarted my OS, and the error was gone!
The error may not be cause by jupyter, but your system.
To clear this, you can try open a simple http server on port 8888 and see whether the failed message is the same.
You can try one of the following commands to start a http server:
python -m SimpleHTTPServer 8888 (Python2)
python -m http.server 8888 (Python3)
I once have met this. It is because your interpreter. The version interpreter of your current project is not suitable for your anaconda. You can change your interpreter and then connect jupyter. That may be helpful. (:D
The solution is simple in Ubuntu and WSL:
jupyter notebook --allow-root --port 9999

Use Jupyter Notebook on my local computer to run code on a remote computer

I use Jupyter Notebook to run bioinformatic analyses, and I love it. However, it only really plays nice when I run it on my personal computer. However, I regularly do analysis using a remote computer with multiple cores to reduce processing time. I'd like to be able to use the Jupyter Notebook interface on my personal computer while everything is actually running on the remote computer. I generally do this via ssh access to the remote computer within the shell and execute all commands at the command line. I'd love to do this from the Jupyter notebook on my personal computer, rather than from the shell on my personal computer. It is relevant that I don't have sudo access on the remote computer.
So far, I've installed miniconda and jupyter notebook on the remote computer like this:
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
Once conda is installed properly, I install jupyter notebook via miniconda with this line:
conda install jupyter
This installs successfully. I can then start a jupyter notebook session on the remote machine with the line:
jupyter notebook --no-browser
So far, so good. My next question: How do I have my local jupyter notebook connect to the remote machine, so that I can execute commands on the remote machine using my local jupyter notebook? There is some documentation here, however i have been trying different things for hours, but have failed to succeed.
Can anyone give a straight forward method to connect to my remote server, given that I am this far along? I feel like it should just be a matter of entering url addresses and passwords into my local Jupyter notebook (all of this is so easy via ssh in the shell).
Follow the steps below:
Enable port forwarding on remote machine
ssh -N -f -L 127.0.0.1:8898:127.0.0.1:8898 user#remote-machine.com
Do ssh to your remote machine and then run following command on remote machine
jupyter-notebook --no-browser --port=8898
you will see some thing as shown below
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8898/token=eaf2f51f9c053f43d8bd093e76f0cc6301b545549c998fa2&token=eaf2f51f9c053f43d8bd093e76f0cc6301b545549c998fa2
Copy and paste the URL in your local machine browser.
If you want to access Jupyter/Ipython notebook running on a VPS remotely, I wrote a tutorial on the digital ocean community site.
As shown in the guide, after installing and running Ipython Notebook using command line on the server, you can connect to the notebook using SSH tunnelling with Putty (on windows) or the ssh -L command on Unix-like systems (ie Mac and Linux)

Jupyter won't connect to a kernel

I'm using django-extensions and I ran shell_plus --kernel and it output:
To connect another client to this kernel, use:
--existing kernel-6690.json
Then I tried connecting with Jupyter:
$ jupyter notebook --existing=kernel-6690.json
[W 10:44:59.290 NotebookApp] Unrecognized alias: '--existing=kernel-6690.json', it will probably have no effect.
...
Why doesn't Jupyter connect to the kernel?
Reviewing https://github.com/ipython/ipython/issues/4066, it appears that the notebook is not able to connect to kernels. In other words for all the talk about how Jupyter notebook is separated into a kernel and frontend it's actually not and this information is not written in any documentation I could find.
Jupyter notebook does not support connecting to an existing kernel. shell_plus --notebook does close enough to what I want.