gnuplot_kernel
gnuplot_kernel copied to clipboard
Windows path 7 Error: End Of File
Sorry if the title isn't that useful.
Im using windows. I installed the gnuplot_kernel and tried to run plot sin(x) and I get the error
"Error: gnuplot not found"
In a python kernel running
from jupyter_client.kernelspec import KernelSpecManager
ksm = KernelSpecManager()
ksm.find_kernel_specs()
I get an output of
{'gnuplot': 'C:\\Users\\deves\\AppData\\Roaming\\jupyter\\kernels\\gnuplot',
'python3': 'C:\\ProgramData\\Anaconda3\\share\\jupyter\\kernels\\python3'}
Looking at the kernel.json it gives the expected
{"argv": ["/usr/bin/python", "-m", "gnuplot_kernel", "-f", "{connection_file}"], "display_name": "gnuplot", "language": "gnuplot", "name": "gnuplot"}
If I copy gnuplot.exe to C:\WINDOWS\ then gnuplot is found but then I get an error of:
Error: End Of File (EOF).
<pexpect.popen_spawn.PopenSpawn object at 0x000001CC7CC52240>
searcher: searcher_re:
0: re.compile('\\w*> $')
1: re.compile('PEXPECT_PROMPT_')
2: re.compile('PEXPECT_PROMPT+')
Any ideas on whats going on? If someone can give me a pointer on where to start then I'll give it a go at working out whats wrong too. Cheers!
I cannot tell what is happening. Try this out from a python kernel.
import pexpect
spawn_cmd = 'path/to/gnuplot'
cmd = 'print "Testing"'
child = pexpect.spawn(spawn_cmd, encoding='utf-8')
child.sendline(cmd)
child.readline()
print(child.buffer) # result
It is a bare-bones test of the communication between python and gnuplot. i.e. gnuplot_kernel stripped to the bone.
Okay, I'll have to do some digging. Windows doesn't have pexpect.spawn() (https://pexpect.readthedocs.io/en/stable/overview.html#pexpect-on-windows).
I'll get back to you..
Try this
from metakernel.pexpect import spawn
spawn_cmd = 'path/to/gnuplot'
cmd = 'print "Testing"'
child = spawn(spawn_cmd, encoding='utf-8')
child.sendline(cmd)
child.readline()
print(child.buffer) # result
Only an empty string comes back
Can you go to the command prompt, start gnuplot and take a screen shot. Something like

I do not have access to a windows machine and I have not used gnuplot on windows. I want to confirm that the text and prompt are just about the same. Specifically, is the prompt gnuplot> , with the space after >?
Here you go. Yeah there is a space after the '>'