月曜日, 10月 03, 2016

The method to open a custom dir(storing the Jupyter's notebooks) within the iCloud Drive(macOS Sierra) by command '$jupyter nootebook'.

Enviroment : macOS 10.12.4(.3~) Sierra , Jupyter client 5.0, Jupiter-core 4.3.0(4.2.0~) ,  anaconda client 1.6.2(1.5.1~)


 1. iCloud Drive's path of the macOS Sierra can get path with terminal by  
 /Users/(user's home dir)/Library/Mobile\ Documents/com\~apple\~CloudDocs/ 
 2. Let's make new dir (folder) in it and set a new name ('Notebook').
 3. then this dir can get path with terminal by 
  /Users/(user's home dir)/Library/Mobile\ Documents/com\~apple\~CloudDocs/Notebook
 4. To generating config file for Jupyter's custom setting, type $jupyter notebook --generate-config and return.
 5. Open this config file named 'Jupiter_notebook_config.py'. (included under /Users/(user's home dir)/.jupyter/) by the text editor you like.
 6. In your text editor, find some line including "## The directory to use for notebooks and kernels." or "#c.NotebookApp.notebook_dir = ''".
 7. Copy and paste #c.NotebookApp.notebook_dir = '' to next line and comment out this line by removing '#in your editor.
 8. Copy path text between '' just like following: c.NotebookApp.notebook_dir = '/Users/(user's home dir)/Library/Mobile Documents/com~apple~CloudDocs/Notebook' in your text editor.
 9. Then you save this file and close the editor.
10. Open Jupyter's notebook  with terminal by command '$jupyter notebook'. Then it shows the notebook dir in the iCloud drive customized above in your default Web browser.