Juypter notebook currently has a limitation: Starting terminal in current directory
How do I do this from command-line (no Anaconda or other GUI), without the following unacceptable hacky approaches? (and in particular where the notebook directory might well change between invocations, or between users?)
Embed hard paths into your notebook code. Must be absolute paths. (yukky). Also user-dependent. Can't distribute notebooks which handle files properly with paths relative to their install dir. Or across machines.
Best solution found so far (on Unix):
jupyter notebook --notebook-dir `pwd` &
because
jupyter notebook --notebook-dir . &
(relative-paths) won't work for commands from inside the notebook.
If you are on Windows, go to command prompt by typing cmd in search box. In cmd prompt, change directory to the path where you want to open Jupyter notebook. This can be done by typing
cd C:\your path here \
Next type in the changed path and press enter/
jupyter notebook
Similarly you can type 'jupyter lab' for jupyter lab
And you are done.
来源:https://stackoverflow.com/questions/47878715/how-do-i-start-jupyter-notebook-from-command-line-to-run-in-my-current-directory