Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
752 views
in Technique[技术] by (71.8m points)

jupyter lab - Running JupyterLab as a Desktop Application in Windows 10

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:ProgramDataAnaconda3Scripts
  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:ProgramDataAnaconda3MenuJupyterlab.ico (=`%ALLUSERSPROFILE%Anaconda3MenuJupyterlab.ico )
  5. Click Change Icon and copy %ALLUSERSPROFILE%Anaconda3MenuJupyterlab.ico in "Look for icons in this file".
  6. Done!

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>.jupyterjupyter_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:UsersSerendipityAppDataRoamingMicrosoftWindowsStart MenuProgramsAnaconda3 (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:UsersSerendipityAnaconda3python.exe C:UsersSerendipityAnaconda3cwp.py C:UsersSerendipityAnaconda3 C:UsersSerendipityAnaconda3python.exe C:UsersSerendipityAnaconda3Scriptsjupyter-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)GoogleChromeApplicationchrome.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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...