How to access Jupyter notebook stored in Windows when Jupyter runs from Ubuntu WSL?
Asked Answered
I

3

8

I have setup WSL (Windows Subsystem for Linux) on Windows 10 and installed Anaconda with python 3 and jupyter lab included. When launching Jupyter lab, I am asked to copy paste http://localhost:8888/lab in my browser, and that works fine. However, I don't know how to access to all my notebooks stored in Windows, I can't browse Windows through Jupyter Lab.

I have searched in Google but can't find the answer.

Does anyone have an idea on how I can browse my notebooks folder stored in Windows?

Infinitesimal answered 28/5, 2019 at 17:29 Comment(0)
F
3

Juggling files between different environments can be a big productivity killer, as you are already finding out. A potential approach would be to:

  1. Organize your files on your local PC into a repository using github.com or equivalent, and pushing those files to your account.

  2. Open a new terminal window in your Jupyter Lab, and pull the repo, substituting your name and email:

$ sudo apt install git
$ git config --global user.name "username" 
$ git config --global user.email "email" 
$ git init 
$ git clone
  1. If you are not already doing, so it may also help you to use a conda environment, and add the spec file to your github repo so that you always know conda environment specification regardless if you are in windows or WSL (or on another server altogether).
$ conda list --explicit > spec-file.txt
$ git add spec-file.txt
$ git commit -m "added spec file for conda environment"
  1. If you installed jupyter using conda, then your conda environment should be 'selectable' within Jupyter Lab, but if not, there are other posts on stackoverflow that show how to configure Jupyter Lab to make sure you can select your various conda environments.
Fealty answered 29/5, 2019 at 15:30 Comment(2)
Thank you! Actually, I just have to change directory : cd ../../mnt/c/Users/ etcInfinitesimal
how you change the directory ? when you define the alias ?Amylose
S
3

Create config file:

jupyter notebook --generate-config

Edit it with text redactor:

nano ~/.jupyter/jupyter_notebook_config.py

Set desired starting directory:

c.NotebookApp.notebook_dir = '/mnt/c/Users/Username/Path'
Seaplane answered 7/3, 2021 at 11:14 Comment(0)
T
0

Go to the WSL terminal:

  1. Run cd /mnt/c/Users/Windows_user_name/ This will point you to all the files in your Windows user account.
  2. Run jupyter notebook

You can then see all the files in Windows within Jupyter Notebook."

Teacart answered 30/8 at 5:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.