22
votes

Cristopher Roach wrote the blog of "Running Jupyter Lab as a Desktop Application" for Mac users. It did not work for Anaconda users in Windows 10. Eventually, what I did is the below:

  1. Go to the directory of C:\ProgramData\Anaconda3\Scripts
  2. Find the file of jupyter-lab.exe and make the link of the file in Taskbars. Note: With some reasons, the message of the "Widows could not create the shortcut. Check to see if the disk is full" popped up when I tried to make the link on the Desktop.
  3. Right click on the link of jupyter-lab.exe and go to Properties.
  4. Download the icon file of Jupyterlab and save it as Jupyterlab.ico in the folder of C:\ProgramData\Anaconda3\Menu\Jupyterlab.ico (=`%ALLUSERSPROFILE%\Anaconda3\Menu\Jupyterlab.ico )
  5. Click Change Icon and copy %ALLUSERSPROFILE%\Anaconda3\Menu\Jupyterlab.ico in "Look for icons in this file".
  6. Done!

Many steps were required to go through. Is there any simpler way?

4
You may refer the video posted here for tutorial on setting Jupterlab as a desktop application. youtube.com/watch?v=BhD1jPOOdro - Regi Mathew

4 Answers

37
votes

1. Set Jupyter Lab to run as a Chrome App

Run Anaconda Prompt from your Start menu and type:

jupyter lab --generate-config

Use your favorite text editor to open the Jupyter config file found on this location:

C:\Users\<User>\.jupyter\jupyter_notebook_config.py

Add this line to the end of the config file:

c.NotebookApp.browser = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe --app=%s"

2. Create a shortcut to run Jupyter Lab

Navigate to

"C:\Users\Serendipity\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)"

Make a copy of the Jupyter Notebook shortcut and name it Jupyter Lab
Right click the newly created Jupyter Lab shortcut and go to Properties, change the icon to your downloaded icon, change the comment field to say "Jupyter Lab". On the Target field, where it says jupyter-notebook-script.py, change it to jupyter-lab-script.py.

The Target field should look like this:

C:\Users\Serendipity\Anaconda3\python.exe C:\Users\Serendipity\Anaconda3\cwp.py C:\Users\Serendipity\Anaconda3 C:\Users\Serendipity\Anaconda3\python.exe C:\Users\Serendipity\Anaconda3\Scripts\jupyter-lab-script.py %USERPROFILE%

Run the shortcut, it should spawn a command prompt running the server instance, and the Jupyter Lab Chrome App window.


Creating a shortcut to access an already locally running server:

You can create a shortcut to connect to a local server with Right Click->New>Shortcut and using this as location target:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app=http://localhost:8888/

You can also start a server without spawning the Chrome App window by typing jupyter lab --no-browser into the Anaconda Prompt console.

5
votes

First write this command it will ask to overwrite please say yes:

Jupyter lab --generate-config

Then open this notebook_config.py file from this location

C:\Users\username\.jupyter\jupyter_notebook_config.py

Paste this line at the end of the file and save it. Note that you might want/have to change the location depending on the .exe (here I will be using the browser Chrome)

c.NotebookApp.browser = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe --app=%s"

Run the jupyter lab from the command line

jupyter lab

For more info follow this link

1
votes

Use shortcut

Create a shortcut with a target:

%windir%\System32\cmd.exe "/K" C:\Users\%username%\Miniconda3\Scripts\activate.bat jupyter_env & jupyter lab && exit

where I supposed you have jupyter-lab installed in the conda environment called jupyter_env. (I don't have it in base.) To create a shortcut, right-click in an empty field in your Windows file explorer, New > Shortcut, and paste in the value above. After that, you can right-click on the shortcut and Properties.

Customize the icon

You can:

  • customize the shortcut's Start in value to %USERPROFILE% or to any specific folder.
  • assign a jupyter icon, I have one in e.g. %USERPROFILE%\miniconda3\envs\jupyter\Menu\jupyter.ico
  • copy the icon to the start menu, %AppData%\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit), if you have Windows 10
  • Pin it to the taskbar once you run jupyterlab using the shortcut. Right-click on the jupyterlab's taskbar icon while it is running and select Pin to taskbar

The original idea is from medium.

0
votes

Much easier. One step only with Codekodo Jupyter (www.codekodo.net). Download, setup and run Jupyter from the systray. That's it.