5

I have a default directory for my Jupyter Notebooks, and I put it in the Jupyter settings. So by default jupytr lab command starts my Jupyter where I need it to start.

However, sometimes I work on separate projects, and it is convenient to start Jupyter in a current working directory from a command line.

Is there an easy command to do so?

Similar question: Change IPython/Jupyter notebook working directory

queezz
  • 1,832
  • 2
  • 20
  • 26

2 Answers2

9

TLDR: jupyter lab .

Original Answer:
Adding on to @queezz, jupyter lab --notebook-dir=. works too because . represents current directory.
Even jupyter lab . works

hiru007
  • 110
  • 3
  • 6
2

I just summarize the answers from the cited similar question here:

jupyter lab --notebook-dir=$pwd

Here $pwd returns the current directory in both Windows and OS X.

queezz
  • 1,832
  • 2
  • 20
  • 26
  • '$pwd' wasn't passing the directory string correctly for me, just an empty string. This lead to a strange error where jupyter would launch correctly but kernels would not. Copy pasting the full directory string solved the issue. – Shri Samson Feb 05 '21 at 06:44
  • That's new. It works for me on Win and Os X. Copy and paste is to much work. Easier to remove the default folder from the settings and just use 'jupyber lab'. – queezz Feb 06 '21 at 07:09