IPython Kernel Connection File Location

760 views
Skip to first unread message

Rafi Bin-Nun

unread,
Dec 20, 2015, 12:51:39 PM12/20/15
to leo-e...@googlegroups.com
Hi, When launching Leo with the IPython bridge  python launchLeo.py --ipython  I get what's listed below... am I doing something wrong?


C:\Program Files (my)\Leo-5.1-final>python launchLeo.py --ipython
C:\Program Files (my)\Anaconda3_py35\lib\site-packages\IPython\kernel\__init__
.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You shoul
d import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)
leoID=my (in C:\Users\rnun\.leo)
reading settings in C:\Program Files (my)\Anaconda3_py35\lib\leo\config\leoSet
tings.leo
reading settings in C:\Users\rnun\.leo\workbook.leo

** isPython3: True
Leo 5.1-final, build 20150416183122, Thu Apr 16 18:31:22 CDT 2015
Not running from a git repo
Python 3.5.1, PyQt version 4.8.7
Windows 7 AMD64 (build 6.1.7601) SP1
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.



To connect another client to this kernel, use:
    --existing kernel-10376.json
Traceback (most recent call last):

  File "C:\Program Files (my)\Anaconda3_py35\lib\leo\plugins\qt_gui.py", line
918, in runWithIpythonKernel
    ipk.new_qt_console(event=None)

  File "C:\Program Files (my)\Anaconda3_py35\lib\leo\core\leoIPython.py", line
 121, in new_qt_console
    profile=self.ipkernel.profile)

  File "C:\Program Files (my)\Anaconda3_py35\lib\site-packages\ipykernel\conne
ct.py", line 162, in connect_qtconsole
    cf = find_connection_file(connection_file, profile=profile)

  File "C:\Program Files (my)\Anaconda3_py35\lib\site-packages\ipykernel\conne
ct.py", line 85, in find_connection_file
    return jupyter_client.find_connection_file(filename, path=['.', security_dir
])

  File "C:\Program Files (my)\Anaconda3_py35\lib\site-packages\jupyter_client\
connect.py", line 185, in find_connection_file
    raise IOError("Could not find %r in %r" % (filename, path))

OSError: Could not find 'kernel-10376.json' in ['.', 'C:\\Users\\rnun\\.ipyth
on\\profile_default\\security']


[rb 12/22: Changed subject to be more accurate.]
Message has been deleted

Rafi Bin-Nun

unread,
Dec 22, 2015, 4:29:15 AM12/22/15
to leo-editor
This is an issue with the kernel connection file (kernel-X.json) location. 

connect.py is expecting it in ~\.ipython\profile_default\security and instead it's being placed in ...\AppData\Roaming\jupyter\runtime. 

Updating  c.ConnectionFileMixin.connection_file  in  ~.ipython\profile_default\ipython_kernel_config.py to a static location allows Leo's IPython bridge to connect but prevents running multiple kernels concurrently unless the c.ConnectionFileMixin.connection_file is reverted after the bridge comes up.

Will update post if I find a better solution.

Edward K. Ream

unread,
Mar 2, 2016, 2:41:53 PM3/2/16
to leo-editor
On Tue, Dec 22, 2015 at 3:29 AM, Rafi Bin-Nun <rafi.cst...@gmail.com> wrote:
This is an issue with the kernel connection file (kernel-X.json) location. 

​Thanks for all your posts about Leo, IPython & Jupyter. Getting Leo's IPython support working is important. It's been on the back burner for far too long. At present, this is scheduled for Leo 5.1.2, which is to say, I'll start work on it in a week or two.

Edward

Edward K. Ream

unread,
Mar 2, 2016, 2:44:51 PM3/2/16
to leo-editor
On Mon, Dec 21, 2015 at 8:48 AM, Rafi Bin-Nun <rafi.cst...@gmail.com> wrote:

Does anyone have any ideas why the connection files are being written to ~\AppData\Roaming\jupyter\runtime\... instead of the expected ~\.ipython\profile_default\security\...? 

​This will be part of the work scheduled for Leo 5.1.2.

EKR
Reply all
Reply to author
Forward
0 new messages