Calysto / metakernel

Jupyter/IPython Kernel Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shell_magic exception on OSX with zsh

parente opened this issue · comments

Spotted this while working on vericast/spylon-kernel#33. When launching a kernel which loads the shell_magic:

[MetaKernelApp] ERROR | Can't load '/Users/parente/miniconda3/envs/spylon-kernel-dev/lib/python3.6/site-packages/metakernel/magics/shell_magic.py': error: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x109706f98>
command: /bin/bash
args: [b'/bin/bash', b'--rcfile', b'/Users/parente/miniconda3/envs/spylon-kernel-dev/lib/python3.6/site-packages/metakernel/bashrc.sh']
buffer (last 100 chars): '\x1b[?1034h(spylon-kernel-dev) '
before (last 100 chars): '\x1b[?1034h(spylon-kernel-dev) '
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 88201
child_fd: 54
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile("[$#]")

I'll try to test this in a plain metakernel install. If it's known that pexpect and metakernel aren't py36 compatible, then please disregard.

Not a py36 problem. It's something about pexpect on my Mac. Maybe with the zsh shell, though when I switch to bash I'm able to reproduce it as well.

What version of metakernal are you using? Is it up to date (--update)?

@parente, what happens if you run that command directly? /bin/bash --rcfile /Users/parente/miniconda3/envs/spylon-kernel-dev/lib/python3.6/site-packages/metakernel/bashrc.sh.

@blink1073 That won't work, because bashrc.sh isn't there... it is in pexpect's directory. I recently attempted to make that a bit more robust, but perhaps it isn't working correctly. See ebbeb9a

I appear to be on the latest.

$ conda list | grep meta
metakernel                0.20.1                    <pip>

Interestingly, it works fine on my Linux VM. The steps I'm using to create this conda environment are the same on both boxes and captured here: https://github.com/maxpoint/spylon-kernel/blob/master/Makefile#L21

I'll try hacking in a few debug statements to see how that __file__ import resolves.

Ah, ebbeb9a is not in a release yet. That's why. I'll install from master and see if the problem is fixed.

Ah, good catch! Sorry about that.

I tested master. The commit @dsblank referenced does indeed fix the problem. Thanks for the help!

0.20.2 is on PyPI, conda build in progress.

0.20.2 is also on conda-forge