Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have the following work around. I launch the SageMath shell from the Windows shortcut.

Then to satrt from E:\username, I type

(sage-sh)> cd /cygdrive/e/username and then (sage-sh)> jupyter notebook

It is quick but not as fast as the "SageMath 8.1 Notebook" shortcut directly installed by the software.

I have the following work around. I launch the SageMath shell from the Windows shortcut.

Then to satrt start from E:\username, I type

(sage-sh)> cd /cygdrive/e/username and then (sage-sh)> jupyter notebook

It is quick but not as fast as the "SageMath 8.1 Notebook" shortcut directly installed by the software.


Experimenting again, I found this "hybrid Linux Windows" solution for the drive problem. I give the full solution for Windows below grouping John Palmieri answer (above) and mine for the user "UserName" willing to have the root directory of jupyter on drive E:, directory E:\UserName\Maths:

  1. After installing SageMath 8.1 click on the shortcut "SageMath 8.1 Shell"

  2. In this shell, execute the instruction :

    sage -n jupyter --generate-config
    
  3. It will generate the message:

    Writing default config to: /dot_sage/jupyter-4.1/jupyter_notebook_config.py
    

    Note that in a windows installation (with OS on the C: drive), this directory is in fact

    C:\Users\UserName.sagemath-8.1\jupyter-4.1

  4. Edit the file C:\Users\UserName.sagemath-8.1\jupyter-4.1\jupyter_notebook_config.py, replacing the line

#c.NotebookApp.notebook_dir = u''

(This line is numbered 195 in my editor, it is a standard default file, it should be the same in yours) with

     c.NotebookApp.notebook_dir = '/cygdrive\e\UserName\Maths'

Note the slashes orientation, you start in Linux mode and finsh in Windows !! This is NOT a typo.

  1. Save the file and click the shortcut "SageMath 8.1 Notebook". Jupyter should have E:\UserName\Maths as root directory.