coq_jupyter icon indicating copy to clipboard operation
coq_jupyter copied to clipboard

Add windows support

Open EugeneLoy opened this issue 6 years ago • 4 comments

EugeneLoy avatar Dec 26 '18 15:12 EugeneLoy

Hello, thanks for your effort. I usually use this on ubuntu 18.04 it works well. Today I tried to this on Windows but doesnt worked. Jupyter Notebook doesnt connect to kernel and output errors;

[IPKernelApp] ERROR | CoqtopError has occured. Scheduling shutdown. Traceback (most recent call last): File "C:\Python\Python37\lib\site-packages\coq_jupyter\coqtop.py", line 78, in init self._coqtop = pexpect.spawn("coqidetop -main-channel stdfds {}".format(coqtop_args), **spawn_args) AttributeError: module 'pexpect' has no attribute 'spawn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python\Python37\lib\site-packages\coq_jupyter\kernel.py", line 59, in wrapper return function(self, *args, **kwargs) File "C:\Python\Python37\lib\site-packages\coq_jupyter\kernel.py", line 99, in init self.coqtop = Coqtop(self, self.coqtop_args) File "C:\Python\Python37\lib\site-packages\coq_jupyter\coqtop.py", line 87, in init raise_with_traceback(CoqtopError("Cause: {}".format(repr(e)))) File "C:\Python\Python37\lib\site-packages\future\utils_init.py", line 446, in raise_with_traceback raise exc.with_traceback(traceback) File "C:\Python\Python37\lib\site-packages\coq_jupyter\coqtop.py", line 78, in init self._coqtop = pexpect.spawn("coqidetop -main-channel stdfds {}".format(coqtop_args), **spawn_args) coq_jupyter.coqtop.CoqtopError: Cause: AttributeError("module 'pexpect' has no attribute 'spawn'")

Python 3.8 / 3.7 jupyter core : 4.6.1 jupyter-notebook : 6.0.3 qtconsole : 4.6.0 ipython : 7.12.0 ipykernel : 5.1.4 jupyter client : 5.3.4 jupyter lab : not installed nbconvert : 5.6.1 ipywidgets : 7.5.1 nbformat : 5.0.4 traitlets : 4.3.3

SotaroOKUDA avatar Feb 10 '20 23:02 SotaroOKUDA

@SotaroOKUDA Hi.

At the moment support for windows is not implemented and, TBH, I am not sure whether it is worth the effort.

If I'll see interest in it I'll look into implementing it, however. Let me know if you need this by "thumbs-up"-ing this ticket.

If someone is willing to do PR for this, the main issue here is that pexpect.spawn is not supported on windows, thus, some alternative should be used. All relevant code is located in coqtop.Coqtop class (see usage of _coqtop property of that class).

EugeneLoy avatar Feb 11 '20 11:02 EugeneLoy

Hi, thanks for your replying! I found wexpect instead pexpect, does this work? Maybe I'll try it for my study. Thank you!

SotaroOKUDA avatar Feb 11 '20 17:02 SotaroOKUDA

@SotaroOKUDA it looks like all required methods are present. Might actually work.

EugeneLoy avatar Feb 12 '20 22:02 EugeneLoy