How to make jupyter start in current directory by default (in cmd.exe)?
In Windows 10 cmd.exe I can start jupyter in a current directory by following command:
jupyter notebook --notebook-dir="."
The current directory is C:UsersЕвгенийDocumentsGitHubsandbox
However, when I start simply jupyter notebook in a current directory above  my working directory for jupyter is D:/git:
λ cd
C:UsersЕвгенийDocumentsGitHubsandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:Anaconda3libsite-packagesjupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:Anaconda3sharejupyterlab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
Note the last line Serving notebooks from local directory: D:/git. Where is D:/git may be coming from? Are there environment variables other than these affecting working directory choice?
- My %USERPROFILE%/.jupyteris totally empty.
 - jupyter --config-dirdirects to- C:UsersЕвгений.jupyter, it is- %USERPROFILE%/.jupyter.
I read various threads about jupyter invoke, in particular:
 this large thread suggests- jupyter notebookwill behave differently in- cmd.exeand Anaconda prompt, without further details though
 Problems with configuring Jupyter start directory addresses an issue with Windows shortcut, similar to this Windows app start steps
 this post proposes wrapping- --notebook-dir="."key into a .bat file
My other thought is that %USERPROFILE% with non-Latin character is not be recongnisable by jupyter, but %USERPROFILE%/.jupyter is empty anyways.
windows cmd jupyter-notebook jupyter
add a comment |
In Windows 10 cmd.exe I can start jupyter in a current directory by following command:
jupyter notebook --notebook-dir="."
The current directory is C:UsersЕвгенийDocumentsGitHubsandbox
However, when I start simply jupyter notebook in a current directory above  my working directory for jupyter is D:/git:
λ cd
C:UsersЕвгенийDocumentsGitHubsandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:Anaconda3libsite-packagesjupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:Anaconda3sharejupyterlab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
Note the last line Serving notebooks from local directory: D:/git. Where is D:/git may be coming from? Are there environment variables other than these affecting working directory choice?
- My %USERPROFILE%/.jupyteris totally empty.
 - jupyter --config-dirdirects to- C:UsersЕвгений.jupyter, it is- %USERPROFILE%/.jupyter.
I read various threads about jupyter invoke, in particular:
 this large thread suggests- jupyter notebookwill behave differently in- cmd.exeand Anaconda prompt, without further details though
 Problems with configuring Jupyter start directory addresses an issue with Windows shortcut, similar to this Windows app start steps
 this post proposes wrapping- --notebook-dir="."key into a .bat file
My other thought is that %USERPROFILE% with non-Latin character is not be recongnisable by jupyter, but %USERPROFILE%/.jupyter is empty anyways.
windows cmd jupyter-notebook jupyter
add a comment |
In Windows 10 cmd.exe I can start jupyter in a current directory by following command:
jupyter notebook --notebook-dir="."
The current directory is C:UsersЕвгенийDocumentsGitHubsandbox
However, when I start simply jupyter notebook in a current directory above  my working directory for jupyter is D:/git:
λ cd
C:UsersЕвгенийDocumentsGitHubsandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:Anaconda3libsite-packagesjupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:Anaconda3sharejupyterlab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
Note the last line Serving notebooks from local directory: D:/git. Where is D:/git may be coming from? Are there environment variables other than these affecting working directory choice?
- My %USERPROFILE%/.jupyteris totally empty.
 - jupyter --config-dirdirects to- C:UsersЕвгений.jupyter, it is- %USERPROFILE%/.jupyter.
I read various threads about jupyter invoke, in particular:
 this large thread suggests- jupyter notebookwill behave differently in- cmd.exeand Anaconda prompt, without further details though
 Problems with configuring Jupyter start directory addresses an issue with Windows shortcut, similar to this Windows app start steps
 this post proposes wrapping- --notebook-dir="."key into a .bat file
My other thought is that %USERPROFILE% with non-Latin character is not be recongnisable by jupyter, but %USERPROFILE%/.jupyter is empty anyways.
windows cmd jupyter-notebook jupyter
In Windows 10 cmd.exe I can start jupyter in a current directory by following command:
jupyter notebook --notebook-dir="."
The current directory is C:UsersЕвгенийDocumentsGitHubsandbox
However, when I start simply jupyter notebook in a current directory above  my working directory for jupyter is D:/git:
λ cd
C:UsersЕвгенийDocumentsGitHubsandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:Anaconda3libsite-packagesjupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:Anaconda3sharejupyterlab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
Note the last line Serving notebooks from local directory: D:/git. Where is D:/git may be coming from? Are there environment variables other than these affecting working directory choice?
- My %USERPROFILE%/.jupyteris totally empty.
 - jupyter --config-dirdirects to- C:UsersЕвгений.jupyter, it is- %USERPROFILE%/.jupyter.
I read various threads about jupyter invoke, in particular:
 this large thread suggests- jupyter notebookwill behave differently in- cmd.exeand Anaconda prompt, without further details though
 Problems with configuring Jupyter start directory addresses an issue with Windows shortcut, similar to this Windows app start steps
 this post proposes wrapping- --notebook-dir="."key into a .bat file
My other thought is that %USERPROFILE% with non-Latin character is not be recongnisable by jupyter, but %USERPROFILE%/.jupyter is empty anyways.
windows cmd jupyter-notebook jupyter
windows cmd jupyter-notebook jupyter
edited Jan 20 at 12:19
EPo
asked Jan 20 at 12:07


EPoEPo
1,7231818
1,7231818
add a comment |
add a comment |
                                2 Answers
                            2
                        
active
oldest
votes
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:Users%username%.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple : 
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
 
 
 
 
 
 
 
 Thanks for the answer, I'm aware of the- notebook --generate-configoption. My specific question is where does jupyter store- D:gitin absence of configuration file. Another internal config file?
 
 – EPo
 Jan 20 at 19:23
 
 
 
 
 
 
 
 
 
 
 If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with- jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.
 
 – ASmallCookie
 Jan 20 at 19:29
 
 
 
 
 
add a comment |
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:Usersusername.jupyterjupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54276261%2fhow-to-make-jupyter-start-in-current-directory-by-default-in-cmd-exe%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
                                2 Answers
                            2
                        
active
oldest
votes
                                2 Answers
                            2
                        
active
oldest
votes
active
oldest
votes
active
oldest
votes
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:Users%username%.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple : 
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
 
 
 
 
 
 
 
 Thanks for the answer, I'm aware of the- notebook --generate-configoption. My specific question is where does jupyter store- D:gitin absence of configuration file. Another internal config file?
 
 – EPo
 Jan 20 at 19:23
 
 
 
 
 
 
 
 
 
 
 If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with- jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.
 
 – ASmallCookie
 Jan 20 at 19:29
 
 
 
 
 
add a comment |
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:Users%username%.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple : 
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
 
 
 
 
 
 
 
 Thanks for the answer, I'm aware of the- notebook --generate-configoption. My specific question is where does jupyter store- D:gitin absence of configuration file. Another internal config file?
 
 – EPo
 Jan 20 at 19:23
 
 
 
 
 
 
 
 
 
 
 If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with- jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.
 
 – ASmallCookie
 Jan 20 at 19:29
 
 
 
 
 
add a comment |
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:Users%username%.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple : 
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:Users%username%.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple : 
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
answered Jan 20 at 19:12


ASmallCookieASmallCookie
2115
2115
 
 
 
 
 
 
 
 Thanks for the answer, I'm aware of the- notebook --generate-configoption. My specific question is where does jupyter store- D:gitin absence of configuration file. Another internal config file?
 
 – EPo
 Jan 20 at 19:23
 
 
 
 
 
 
 
 
 
 
 If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with- jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.
 
 – ASmallCookie
 Jan 20 at 19:29
 
 
 
 
 
add a comment |
 
 
 
 
 
 
 
 Thanks for the answer, I'm aware of the- notebook --generate-configoption. My specific question is where does jupyter store- D:gitin absence of configuration file. Another internal config file?
 
 – EPo
 Jan 20 at 19:23
 
 
 
 
 
 
 
 
 
 
 If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with- jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.
 
 – ASmallCookie
 Jan 20 at 19:29
 
 
 
 
 
Thanks for the answer, I'm aware of the
notebook --generate-config option. My specific question is where does jupyter store D:git in absence of configuration file. Another internal config file?– EPo
Jan 20 at 19:23
Thanks for the answer, I'm aware of the
notebook --generate-config option. My specific question is where does jupyter store D:git in absence of configuration file. Another internal config file?– EPo
Jan 20 at 19:23
If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with
jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.– ASmallCookie
Jan 20 at 19:29
If we don't generate a configuration, I don't think Jupyter stores another configuration file. I just know that you can switch configuration files with
jupyter -f /path/to/configFile.py. I advise you to use Jupyterlab. For me, the configuration with Jupyterlab works well.– ASmallCookie
Jan 20 at 19:29
add a comment |
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:Usersusername.jupyterjupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
add a comment |
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:Usersusername.jupyterjupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
add a comment |
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:Usersusername.jupyterjupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:Usersusername.jupyterjupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
answered Jan 20 at 22:52
ShinigamiShinigami
567
567
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54276261%2fhow-to-make-jupyter-start-in-current-directory-by-default-in-cmd-exe%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
