[IPython-dev] How do I change kernel in Jupyter Notebook w/o working directory changes

Thomas Kluyver takowl at gmail.com
Sat Apr 25 14:15:01 EDT 2015

Hi Ruslan,

I see you're sshing to the remote machine to start the kernel. The working
directory depends on where you start the kernel, so it's your home
directory because that's where you start in when you ssh in. If the
directories on your remote machine match local directories, you can get the
working directory on the local machine using 'pwd' inside remote_kernel.sh,
and when you ssh to the remote machine, cd to the location you want before
starting the kernel.

Hope that helps,

On 25 April 2015 at 09:28, Ruslan Korniichuk <
paad.ruslan.korniichuk at gmail.com> wrote:

> Hi all,
> All history of this subject is available HERE:
> http://goo.gl/rOv8r2
> Thanks to Thomas Kluyver. Now I can run in one Jupyter Notebook local and
> remote kernels. But I can not fix one interesting moment with working
> directory.
> For example,
> *pc-frontend: test at local_host*
> and
> *pc-backend: paad at remote_host.*
> Username on a local machine is NOT the same as username on a remote
> machine. *When I start Jupyter Notebook on a local machine with a local
> kernel, my working directory is **“/home/test” (!pwd). Next I change
> kernel  in Jupyter Notebook from local to remote and check (!pwd) my
> working directory. My working directory is “/home/paad”**.* My Notebook
> is on a local machine.
> I read this articles:
> http://ipython.org/ipython-doc/dev/config/options/notebook.html
> http://ipython.org/ipython-doc/dev/config/options/kernel.html
> and tried change “c.NotebookApp.notebook_dir” in
> ipython_notebook_config.py. But this option does not available for kernel.
> *When the working directory changes? What process is responsible for this?
> Maybe somebody know how fix it and switch off working directory changes?*
> ---
> Best regards,
> Ruslan Korniichuk
> _______________________________________________
> 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/20150425/2d1429f3/attachment.html>

More information about the IPython-dev mailing list