[IPython-dev] Get notebook kernels to start in the same folder as the notebook .ipynb file

MinRK benjaminrk at gmail.com
Mon Apr 6 17:28:39 EDT 2015


In IPython >= 2, the config value you probably want
is `NotebookApp.notebook_dir`. If you set it for notebooks directly, rather
than the top-level app, you can have a different directory for notebooks
and kernels.

-MinRK

On Mon, Apr 6, 2015 at 2:25 PM, William Shipman <shipman.william at gmail.com>
wrote:

> I originally had those settings so that the default profile would always
> start up in that IPython folder in my git folder. That used to work.
>
> I commented out those two lines and then ran 'ipython notebook' from cmd
> in my 'C:\Users\wjs\git\IPython' folder and it worked properly.
>
> I think the problem comes from working around an old WinPython
> distribution. The 'IPython Notebook.exe' that I have stopped working when I
> upgraded to IPython 2.3. I never fixed that, but instead just created a
> shortcut from which to launch 'ipython notebook'. If I set the working
> directory for that shortcut to 'C:\Users\wjs\git\IPython' and use it to
> launch the notebook server then, with or without the notebook_dir lines, it
> behaves properly.
>
> Do I need the notebook_dir settings?
>
> Thanks for helping me MinRK. The problem is now fixed.
>
> On 6 April 2015 at 21:34, MinRK <benjaminrk at gmail.com> wrote:
>
>> If you comment out the `notebook_dir` settings, does it work as expected?
>>
>> On Mon, Apr 6, 2015 at 11:07 AM, William Shipman <
>> shipman.william at gmail.com> wrote:
>>
>>> To summarise the non-default settings:
>>>
>>> import webbrowser
>>> webbrowser.register('firefox', None,
>>> webbrowser.GenericBrowser(u'C:\\Program Files (x86)\\Mozilla
>>> Firefox\\firefox.exe'))
>>> c.NotebookApp.browser = 'firefox'
>>>
>>> c.ZMQInteractiveShell.colors = 'Linux'
>>>
>>> c.NotebookManager.notebook_dir = u'C:\\Users\\wjs\\git\\IPython'
>>>
>>> c.FileNotebookManager.notebook_dir = u'C:\\Users\\wjs\\git\\IPython'
>>>
>>> I've also attached the complete 'ipython_notebook_config.py' in case it
>>> helps.
>>>
>>>
>>>
>>> On 6 April 2015 at 19:58, MinRK <benjaminrk at gmail.com> wrote:
>>>
>>>> You have described the current default behavior of IPython. So I'm
>>>> wondering if you have anything in your `ipython_notebook_config.py` that is
>>>> causing the behavior to be something different.​ The file will be in
>>>> `~/.ipython/profile_default/ipython_notebook_config.py`.
>>>>
>>>> -MinRK
>>>>
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150406/80d501f3/attachment.html>


More information about the IPython-dev mailing list