Change anaconda ipython main directory

后端 未结 8 1934
误落风尘
误落风尘 2020-12-24 03:07

I\'ve jus installed anaconda and I see that it wants me to save my documents in my documents/python scripts

But I\'d rather save everything in my dropbox for easy ba

相关标签:
8条回答
  • 2020-12-24 03:34

    Not sure if this is helpful, but as of 11/2/15, Anaconda 2.4.0 moved to Jupyter, which has a different method for changing the default directory

    In the command line type:

    jupyter notebook --generate-config
    

    Which will create a file named jupyter_notebook_config.py in your jupyter directory (In Windows Users/USERNAME/.jupyter). To change the default directory on startup, locate the line:

    c.NotebookApp.notebook_dir = u''
    

    And put your preferred directory in the quotes.

    0 讨论(0)
  • 2020-12-24 03:34

    I have found a solution for this.

    Get the python script that launches Jupyther Network app called jupyter-notebook-script.py (it is usually located in C:\Anaconda3\Scripts\). Then modify content of the script with this:

    import sys
    import notebook.notebookapp 
    
    notebook.notebookapp.NotebookApp.notebook_dir = u'C:\\path\\to\\folder'
    
    sys.exit(notebook.notebookapp.main())
    

    It worked for me on Windows 7.

    0 讨论(0)
  • 2020-12-24 03:38

    For change working directory on the Mac with Anaconda app Launcher Jupyter for another directory then home

    change file /Applications/anaconda3/bin/jupyter_mac.command Your needed dir change path in example /Volumes/BOOTCAMP/

    DIR=$(dirname $0)
    $DIR/jupyter-notebook --notebook-dir=/Volumes/BOOTCAMP/
    
    0 讨论(0)
  • 2020-12-24 03:38

    People visiting now in 2020 for Win10, The official instructions have been mentioned below. For me none of the methods like changing in conf.py etc helped.. We need to go to the shortcut properties and change the path there:

    https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html#change-jupyter-notebook-startup-folder-windows

    0 讨论(0)
  • 2020-12-24 03:40

    You can change the default directory for notebooks. It can be done permanently in ipython notebook config files. Firstly, locate the ipython profile, in the cmdline, type:

    $> ipython locate

    Default profile location (using Anaconda) is: %USERNAME%\.ipython

    then, in file ipython_notebook_config.py (if it's default profile go into folder \profile_default), uncommnet and edit line:

    c.FileNotebookManager.notebook_dir = u'C:\\Users\\Lukasz\\Documents\\Github'

    changing the my path to whatever path you like.

    Really useful website is: http://ipython.org/ipython-doc/dev/config/intro.html

    After above step Ipython should start with proper path.

    It works for me.

    0 讨论(0)
  • 2020-12-24 03:50

    You can right click the Start menu shortcut and change the starting directory.

    It's not as easy to change the directory used by the Launcher. I think in principle you could edit some file somewhere to change what directory it uses.

    0 讨论(0)
提交回复
热议问题