Closed scimax closed 6 years ago
does not return anything
That is the problem, and this path issue has only been reported by windows users. Can you try pexpect.which('some-other-executables')
.
For pexpect.which('notepad.exe')
it returns the expected path to the executable. I also tried a few other applications as well. Some work, some don't... strange.
But after trying a few applications I realized that sometimes it works only with .exe
. And, there it is:
import pexpect
pexpect.which('gnuplot.exe')
Output:
C:\\Program Files\\gnuplot\\bin\\gnuplot.exe
I changed the command parameter in makeWrapper(self)
of kernel.py and it seems to work now. But I had to remove the environment variable in front. According to the comment in the line before, the variable is necessary for help commands. So we have to find away around.
The kernel seems to be stable now.
def makeWrapper(self):
"""
Start gnuplot and return wrapper around the REPL
"""
if not pexpect.which('gnuplot'):
raise Exception("gnuplot not found.")
# We don't want help commands getting stuck,
# use a non interactive PAGER
command = 'gnuplot.exe'
d = dict(cmd_or_spawn=command,
prompt_regex=u('\w*> $'),
prompt_change_cmd=None)
wrapper = GnuplotREPLWrapper(**d)
...
Yes! that line should trip up windows systems.
I have not tested the "fix". Just hoping that it should work.
Well, unfortunately not 100%. When I tested it, the kernel didn't die anymore. But when I tried to execute a cell, it kept running infinitely without any output. At that time yesterday, I had no internet connection. Sorry!
But actually it could originate from a different issue. So the original issue of a permanently dying kernel is really solved.
It could not be related to the missing environment variable, can it? I don't know gnuplot very well yet.
Ah, I just saw that you have some handling of the environment variable as well. I will test this as soon as possible!
Hi,
I experienced an issue similar to #10, but since the traceback is different the solution to the problem is probably also somewhere else.
I'm running jupyter (lab) on a Windows 10 machine with plain python 3.6 (no distribution like conda). For the installation I tried
pip install gnuplot_kernel
but since the kernel was not found by jupyter I installed it directly from GitHub,pip install --upgrade --no-cache-dir git+https://github.com/has2k1/gnuplot_kernel.git
. At least the kernel is available in jupyter now, but it constantly dies with the ExceptionFileNotFoundError: [WinError 2] The system cannot find the file specified
The full traceback:
According to the suggestions in #10 I checked the kernel specs and the kernel.json. The path to python is correct.
does not return anything. I alson checked the path variable. The path to gnuplot is in there and it also works on the command line.
System configuration Jupyter 4.4.0 Python 3.6.4 Windows 10