How to make jupyter start in current directory by default (in cmd.exe)?












0















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%/.jupyter is totally empty.


  • jupyter --config-dir directs to C:UsersЕвгений.jupyter, it is %USERPROFILE%/.jupyter.


I read various threads about jupyter invoke, in particular:





  • this large thread suggests jupyter notebook will behave differently in cmd.exe and 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.










share|improve this question





























    0















    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%/.jupyter is totally empty.


    • jupyter --config-dir directs to C:UsersЕвгений.jupyter, it is %USERPROFILE%/.jupyter.


    I read various threads about jupyter invoke, in particular:





    • this large thread suggests jupyter notebook will behave differently in cmd.exe and 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.










    share|improve this question



























      0












      0








      0








      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%/.jupyter is totally empty.


      • jupyter --config-dir directs to C:UsersЕвгений.jupyter, it is %USERPROFILE%/.jupyter.


      I read various threads about jupyter invoke, in particular:





      • this large thread suggests jupyter notebook will behave differently in cmd.exe and 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.










      share|improve this question
















      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%/.jupyter is totally empty.


      • jupyter --config-dir directs to C:UsersЕвгений.jupyter, it is %USERPROFILE%/.jupyter.


      I read various threads about jupyter invoke, in particular:





      • this large thread suggests jupyter notebook will behave differently in cmd.exe and 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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 20 at 12:19







      EPo

















      asked Jan 20 at 12:07









      EPoEPo

      1,7231818




      1,7231818
























          2 Answers
          2






          active

          oldest

          votes


















          0














          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.






          share|improve this answer
























          • 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





















          0














          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






          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            0














            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.






            share|improve this answer
























            • 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


















            0














            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.






            share|improve this answer
























            • 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
















            0












            0








            0







            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.






            share|improve this answer













            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 20 at 19:12









            ASmallCookieASmallCookie

            2115




            2115













            • 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





















            • 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



















            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















            0














            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






            share|improve this answer




























              0














              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






              share|improve this answer


























                0












                0








                0







                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






                share|improve this answer













                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 20 at 22:52









                ShinigamiShinigami

                567




                567






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Liquibase includeAll doesn't find base path

                    How to use setInterval in EJS file?

                    Petrus Granier-Deferre