Calysto / xonsh_kernel

Jupyter Kernel for Xonsh
22 stars 2 forks source link

Testing on windows (anaconda installation) #1

Closed melund closed 8 years ago

melund commented 9 years ago

Hi

I just tried this in my Anaconda distribution on windows.

I got the following error. I don't know if you expected it to work on windows, but I got the following ERROR. Maybe it is useful.

C:\Users\mel\Documents\GitHub\xonsh_kernel>ipython qtconsole --kernel=xonsh_kernel
---------------------------------------------------------------------------
TIMEOUT                                   Traceback (most recent call last)
C:\Users\mel\Anaconda3\lib\site-packages\metakernel-0.9.0-py3.4.egg\metakernel\pexpect.py in expect_loop(self=<metakernel.pexpect.Ex
pecter object>, timeout=-0.0007159709930419922)
    222                 if (timeout is not None) and (timeout < 0):
--> 223                     return self.timeout()
        self.timeout = <bound method Expecter.timeout of <metakernel.pexpect.Expecter object at 0x00000000048C4358>>
    224                 # Still have time left, so read more data

C:\Users\mel\Anaconda3\lib\site-packages\metakernel-0.9.0-py3.4.egg\metakernel\pexpect.py in timeout(self=<metakernel.pexpect.Expect
er object>, err=None)
    196                 msg = str(err) + '\n' + msg
--> 197             raise TIMEOUT(msg)
        global TIMEOUT = <class 'metakernel.pexpect.TIMEOUT'>
        msg = "<metakernel.pexpect.spawnu object at 0x00000000048C4278>\nversion: 3.3\ncommand: C:\\Users\\mel\\Anaconda3\\Scripts\\
xonsh.EXE\nargs: ['C:\\\\Users\\\\mel\\\\Anaconda3\\\\Scripts\\\\xonsh.EXE']\nsearcher: None\nbuffer (last 100 chars): ''\nbefore (l
ast 100 chars): ''\nafter: <class 'metakernel.pexpect.TIMEOUT'>\nmatch: None\nmatch_index: None\nexitstatus: None\nflag_eof: False\n
pid: 11372\nchild_fd: 7\nclosed: False\ntimeout: 30\ndelimiter: <class 'metakernel.pexpect.EOF'>\nlogfile: None\nlogfile_read: None\
nlogfile_send: None\nmaxread: 2000\nignorecase: False\nsearchwindowsize: None\ndelaybeforesend: 0.05\ndelayafterclose: 0.1\ndelayaft
erterminate: 0.1"
    198

TIMEOUT: <metakernel.pexpect.spawnu object at 0x00000000048C4278>
version: 3.3
command: C:\Users\mel\Anaconda3\Scripts\xonsh.EXE
args: ['C:\\Users\\mel\\Anaconda3\\Scripts\\xonsh.EXE']
searcher: None
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'metakernel.pexpect.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 11372
child_fd: 7
closed: False
timeout: 30
delimiter: <class 'metakernel.pexpect.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
blink1073 commented 9 years ago

Hi @melund, thanks for the report; I admit I was not brave enough to test this on Windows :smile:.

melund commented 9 years ago

No problem. Let me know if I should test other things.

blink1073 commented 9 years ago

I'm not sure I'd even know where to point you, I'll give it a shot next time I fire up my Windows VM.

melund commented 9 years ago

I have no idea either. But a little digging reveals that pexpect may not work on the windows platform. There is a port of pexpect to windows, which may be merged into pexpect at some time.

https://bitbucket.org/geertj/winpexpect/wiki/Home

From the homepage:


Using WinPexpect

The API of winpexpect is identical to that of pexpect. The only difference is that you must use the class "winspawn" instead of "spawn". So:

from winpexpect import winspawn
child = winspawn('powershell')

blink1073 commented 9 years ago

Ah, you hit the nail on the head. There is a minimal version of pexpect in Metakernel, but it uses os.pipe on Windows (which is what the next version of pexpect will have to do as well). I have tried Winpexpect and it will not run a Python interpreter in a child process. I'm afraid the lack of a pseudo-tty on Windows is probably a show-stopper.

melund commented 9 years ago

That doesn't sound very promising... I have never used pexpect, but why can't winpexpect not run a python interpreter in a child process?

blink1073 commented 9 years ago

I don't know, but it is very frustrating. I tried it a couple of weeks ago. I had the same issue with winpty.

blink1073 commented 8 years ago

This will be fixed when #3 is merged.