has2k1 / gnuplot_kernel Goto Github PK
View Code? Open in Web Editor NEWA Jupyter/IPython kernel for gnuplot
License: BSD 3-Clause "New" or "Revised" License
A Jupyter/IPython kernel for gnuplot
License: BSD 3-Clause "New" or "Revised" License
If I have an ordinary gnuplot script file that contains, say, the line:
set xlabel "β(°)"
Then, when executed, gnuplot does the expected and labels the x axis with the text "β(°)".
If I put exactly the same text into a cell that is run with the gnuplot jupyter kernel, then both of the non-ASCII characters appear in the label as garbled.
The same failure is apparent in titles.
I noticed when I remove lines and ctrl+enter (iterate), it still appears to have the previous commands in effect.
This is very confusing and results in situations where I've after I've refactored, I don't have a working gnuplot.
https://s.natalian.org/2020-07-10/removing-lines.mp4
Any tips please?
Installed /home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/gnuplot_kernel-0.3.0-py2.7.egg
Processing dependencies for gnuplot-kernel==0.3.0
Searching for notebook>=5.4.0
Reading https://pypi.org/simple/notebook/
Downloading https://files.pythonhosted.org/packages/02/99/951cc76e3340af06c617079f65c65390507cce95c18cf28591659479208b/notebook-6.0.0.tar.gz#sha256=5c16dbf4fa824db19de43637ebfb24bcbd3b4f646e5d6a0414ed3a376d6bc951
Best match: notebook 6.0.0
Processing notebook-6.0.0.tar.gz
Writing /tmp/easy_install-FMBb8Z/notebook-6.0.0/setup.cfg
Running notebook-6.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-FMBb8Z/notebook-6.0.0/egg-dist-tmp-2IHYnj
Notebook 6.0+ supports Python 3.4 and above.
When using Python 2.7, please install Notebook 5.x.
Python sys.version_info(major=2, minor=7, micro=15, releaselevel='final', serial=0) detected.
``
How come SVG doesn't appear to work here?
https://s.natalian.org/2020-07-09/svg-gnuplot.png
# git rev-list --count master
$commits << EOD
gecko 716280
webkit 226748
blink 400000
EOD
set terminal svg
set yrange [0:*] # start at zero, find max from the data
set boxwidth 0.5 # use a fixed width for boxes
unset key # turn off all titles
set style fill solid # solid color boxes
set ytics format "%.0s%c" # will generate labels 100k 200k 300k ... 1M
set title 'commits'
plot '$commits' using 2:xtic(1) with boxes
Sidenote: Learned about this project via Lee Philips of the gnuplot 5 book. The ctrl+enter workflow that Jupyter Notebook in a browser offers is far easier than working on the command line. Is this experience offered on a public URL somewhere? Or can it be? (happy to host)
The kernel fails to load on both Jupyter Lab and VS Code on Windows 10. I tried installing gnuplot_kernel using pip and used the python command to register the kernel but it still desn't work.
hi,
I just tried to install the kernel as you described.
Result: no GnuPlot kernel in jupyter notebook.
After I added a kernel.json in usr/local/share/jupyter/kernels/gnuplot_kernel it works fine.
Content of kernel.json:
{"argv": ["/usr/bin/python", "-m", "gnuplot_kernel", "-f", "{connection_file}"], "display_name": "GnuPlot", "language": "gnuplot", "name": "gnuplot_kernel"}
regrads
oni
Since metakernel install changed, you need to do three things:
__main__.py
to:from .kernel import GnuplotKernel
if __name__ == "__main__":
GnuplotKernel.run_as_main()
import sys
class GnuplotKernel(ProcessMetaKernel):
kernel_json = {
'argv': [sys.executable,
'-m', 'gnuplot_kernel',
'-f', '{connection_file}'],
'display_name': 'gnuplot',
'language': 'gnuplot',
'name': 'gnuplot',
}
Then you can install the kernel through recommended:
pip install gnuplot_kernel
python -m gnuplot_kernel install
Interactively, to generate a hardcopy of the currently displayed plot, one typically performs something like:
set output 'file.eps'
set terminal eps
replot
unset output
set terminal qt
I even have a print.gp
file that does just that, so I load 'print.gp'
.
Trying to do the same from inside a jupyter python 3 notebook, with gnuplot_kernel loaded does not seem to work.
%load_ext gnuplot_kernel
%gnuplot inline pngcairo size 640,480 font "Palatino,16"
%%gnuplot
plot sin(x)
set output 'gnuplot.eps'
set terminal postscript eps size 6.4,4.8
replot
%%bash
ls -la gnuplot.eps
reports an empty file, i.e. file gets created but has zero size. In the attached PDF, note also the broken image file icon at that point in the output.
On the other hand,
%gnuplot postscript eps size 6.4,4.8
%%gnuplot
set output 'gnuplot.eps'
plot cos(x)
works as expected, except, of course, there is no seeing the plot before producing a hardcopy.
Is this as expected, or am I doing something wrong?
mozilla.pdf
Gnuplot is installed, is in PATH and by itself works correctly. Notebook is also works fine with different kernels (python, lua, c++). The gnuplot kernel and the metakernel are installed with pip. I also added required by metakernel commands to ipython_config.py, which are being executed on start.
The kernel itself can be started but when I try to run a cell the kernel creates a new gnuplot.exe process, then it becomes busy and stays busy until I manually shut it down. It also can be loaded with %load_ext
function, but when I run %gnuplot ...
I get the same result. I tried both ways of execution in both jupyter notebook and jupyter console. There are no error messages whatsoever, it just gets stuck.
OS: Windows 10 build 19045.2604
Python: 3.11.0
Gnuplot kernel: 0.4.1
Hello,
I have installed the latest versions of jupyter notebook, gnuplot, and metakernel on my system.
I'm attempting to use your gnuplot_kernel with gnuplot magic inside of a Python 3 notebook. I'm not quite sure what the issue is.
I am using your gnuplot-magic.ipynb file as a test-case for this.
The first cell in the notebook with "%load_ext gnuplot_kernel" runs just fine with no error. However, when I attempt to run gnuplot in a cell with %%gnuplot to enable gnuplot magic, I get the following error:
AttributeError Traceback (most recent call last)
in ()
----> 1 get_ipython().magic('gnuplot inline')
/Users/lafosse/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
2156 magic_name, _, magic_arg_s = arg_s.partition(' ')
2157 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158 return self.run_line_magic(magic_name, magic_arg_s)
2159
2160 #-------------------------------------------------------------------------
/Users/lafosse/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
2077 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078 with self.builtin_trap:
-> 2079 result = fn(*args,**kwargs)
2080 return result
2081
/Users/lafosse/anaconda/lib/python3.5/site-packages/gnuplot_kernel/magics/gnuplot_magic.py in gnuplot(line)
119 @register_line_magic
120 def gnuplot(line):
--> 121 magic.line_gnuplot(line)
122
123 del gnuplot
/Users/lafosse/anaconda/lib/python3.5/site-packages/gnuplot_kernel/magics/gnuplot_magic.py in line_gnuplot(self, *args)
63 self.kernel.plot_settings['termspec'] = termspec
64 self.kernel.plot_settings['format'] = format
---> 65 self.kernel.handle_plot_settings()
66
67 def cell_gnuplot(self):
/Users/lafosse/anaconda/lib/python3.5/site-packages/gnuplot_kernel/kernel.py in handle_plot_settings(self)
278
279 cmd = 'set terminal {}'.format(settings['termspec'])
--> 280 super(GnuplotKernel, self).do_execute_direct(cmd)
/Users/lafosse/anaconda/lib/python3.5/site-packages/metakernel/process_metakernel.py in do_execute_direct(self, code, silent)
109 if output:
110 if stream_handler:
--> 111 stream_handler(output)
112 else:
113 return TextOutput(output)
/Users/lafosse/anaconda/lib/python3.5/site-packages/metakernel/_metakernel.py in Print(self, *args, **kwargs)
638 'name': 'stdout', 'text': message}
639 self.log.debug('Print: %s' % message)
--> 640 self.send_response(self.iopub_socket, 'stream', stream_content)
641
642 def Write(self, message):
/Users/lafosse/anaconda/lib/python3.5/site-packages/ipykernel/kernelbase.py in send_response(self, stream, msg_or_type, content, ident, buffers, track, header, metadata)
344 """
345 return self.session.send(stream, msg_or_type, content, self._parent_header,
--> 346 ident, buffers, track, header, metadata)
347
348 def init_metadata(self, parent):
/Users/lafosse/anaconda/lib/python3.5/site-packages/jupyter_client/session.py in send(self, stream, msg_or_type, content, parent, ident, buffers, track, header, metadata)
682 # use dummy tracker, which will be done immediately
683 tracker = DONE
--> 684 stream.send_multipart(to_send, copy=copy)
685
686 if self.debug:
AttributeError: 'NoneType' object has no attribute 'send_multipart'
I am uncertain of how to go about fixing this issue, any suggestions? I am also running on macOS Sierra. I'm not sure if this is the root of the issue or not.
Thanks!
When I am running the test I am looking this errors.
============================= test session starts ==============================
platform linux -- Python 3.10.8, pytest-7.2.0, pluggy-1.0.0
rootdir: /tmp/makepkg/jupyter-gnuplot_kernel/src/gnuplot_kernel-0.4.1, configfile: pytest.ini
collected 15 items
gnuplot_kernel/tests/test_kernel.py FFFFFFFFFFFFFF. [100%]
=================================== FAILURES ===================================
______________________________ test_inline_magic _______________________________
def test_inline_magic():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9073100>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9073100>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9073100>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
__________________________________ test_print __________________________________
def test_print():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec901b6d0>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec901b6d0>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec901b6d0>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
_______________________________ test_file_plots ________________________________
def test_file_plots():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec90[714](https://gitlab.com/dune-archiso/repository/dune-archiso-repository-extra/-/jobs/3378713709#L714)80>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9071480>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9071480>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
______________________________ test_inline_plots _______________________________
def test_inline_plots():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8efd9c0>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8efd9c0>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8efd9c0>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
___________________________ test_plot_abbreviations ____________________________
def test_plot_abbreviations():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8ff3280>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8ff3280>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8ff3280>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
________________________________ test_multiplot ________________________________
def test_multiplot():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f[788](https://gitlab.com/dune-archiso/repository/dune-archiso-repository-extra/-/jobs/3378713709#L788)80>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f78880>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f78880>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
__________________________________ test_help ___________________________________
def test_help():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:185:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f3e500>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f3e500>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f3e500>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
________________________________ test_badinput _________________________________
def test_badinput():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:206:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec90186a0>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec90186a0>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec90186a0>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
__________________________ test_gnuplot_error_message __________________________
def test_gnuplot_error_message():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f7b190>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f7b190>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8f7b190>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
_______________________________ test_bad_prompt ________________________________
def test_bad_prompt():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8efd8a0>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8efd8a0>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8efd8a0>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
_______________________________ test_data_block ________________________________
def test_data_block():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:236:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8fa98d0>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8fa98d0>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8fa98d0>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
_______________________________ test_cell_magic ________________________________
def test_cell_magic():
# To simulate '%load_ext gnuplot_kernel';
# create a main kernel, a gnuplot kernel and
# a gnuplot magic that uses the gnuplot kernel.
# Then manually register the gnuplot magic into
# the main kernel.
> kernel = get_kernel()
gnuplot_kernel/tests/test_kernel.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:29: in get_kernel
kernel = _get_kernel()
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <metakernel._metakernel.MetaKernel object at 0x7fcec8f7b5e0>, args = ()
kwargs = {'kernel': <metakernel._metakernel.MetaKernel object at 0x7fcec8f7b5e0>, 'parent': <metakernel._metakernel.MetaKernel object at 0x7fcec8f7b5e0>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
____________________________ test_reset_cell_magic _____________________________
def test_reset_cell_magic():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:313:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8eff280>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8eff280>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec8eff280>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
____________________________ test_reset_line_magic _____________________________
def test_reset_line_magic():
> kernel = get_kernel(GnuplotKernel)
gnuplot_kernel/tests/test_kernel.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gnuplot_kernel/tests/test_kernel.py:27: in get_kernel
kernel = _get_kernel(klass)
/usr/lib/python3.10/site-packages/metakernel/tests/utils.py:84: in get_kernel
kernel = kernel_class(session=ss.Session(), iopub_socket=iopub_socket,
/usr/lib/python3.10/site-packages/metakernel/process_metakernel.py:53: in __init__
MetaKernel.__init__(self, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec[907](https://gitlab.com/dune-archiso/repository/dune-archiso-repository-extra/-/jobs/3378713709#L907)3f70>, args = ()
kwargs = {'kernel': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9073f70>, 'parent': <gnuplot_kernel.kernel.GnuplotKernel object at 0x7fcec9073f70>}
def __init__(self, *args, **kwargs):
super(MetaKernel, self).__init__(*args, **kwargs)
if MetaKernel.meta_kernel is None:
MetaKernel.meta_kernel = self
if self.log is None:
# This occurs if we call as a stand-alone kernel
# (eg, not as a process)
# FIXME: take care of input/output, eg StringIO
# make work without a session
self.log = logging.Logger(".metakernel")
else:
# Write has already been set
try:
sys.stdout.write = self.Write
except:
pass # Can't change stdout
self.redirect_to_log = False
self.shell = None
self.sticky_magics = OrderedDict()
self._i = None
self._ii = None
self._iii = None
self._ = None
self.__ = None
self.___ = None
self.max_hist_cache = 1000
self.hist_cache = []
kwargs = {'parent': self,
'kernel': self}
if not PY3:
kwargs['shell'] = None
> self.comm_manager = CommManager(**kwargs)
E TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:155: TypeError
=============================== warnings summary ===============================
../../../../../usr/lib/python3.10/site-packages/_pytest/config/__init__.py:[1294](https://gitlab.com/dune-archiso/repository/dune-archiso-repository-extra/-/jobs/3378713709#L1294)
/usr/lib/python3.10/site-packages/_pytest/config/__init__.py:1294: PytestConfigWarning: Unknown config option: pyargs
self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
gnuplot_kernel/kernel.py:290
/tmp/makepkg/jupyter-gnuplot_kernel/src/gnuplot_kernel-0.4.1/gnuplot_kernel/kernel.py:290: DeprecationWarning: invalid escape sequence '\w'
prompt_regex=u('\w*> $'),
../../../../../usr/lib/python3.10/site-packages/metakernel/_metakernel.py:20
/usr/lib/python3.10/site-packages/metakernel/_metakernel.py:20: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
given by the platformdirs library. To remove this warning and
see the appropriate new directories, set the environment variable
`JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
The use of platformdirs will be the default in `jupyter_core` v6
from jupyter_core.paths import jupyter_config_path, jupyter_config_dir
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED gnuplot_kernel/tests/test_kernel.py::test_inline_magic - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_print - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_file_plots - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_inline_plots - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_plot_abbreviations - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_multiplot - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_help - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_badinput - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_gnuplot_error_message - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_bad_prompt - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_data_block - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_cell_magic - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_reset_cell_magic - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
FAILED gnuplot_kernel/tests/test_kernel.py::test_reset_line_magic - TypeError: CommManager.__init__() got an unexpected keyword argument 'parent'
=================== 14 failed, 1 passed, 3 warnings in 0.85s ===================
It is the program not working properly?
Hi
Im new to Jupyter and python. Having used Gnuplot in the past, I thought it was nice to try and integrate it in Jupyter, and installed the kernel. with pip. I have been trying to use it in Anaconda 3 (Python 3.6)
But: I had forgotten I did not have gnuplot on this machine, but the kernel installed anyway.
After this I have tried to uninstall, install Gnuplot 5.2, and re-install with pip, and then create a conda environment with gnuplot_kernel and python 3.6. I got no visible kernel in the notebook UI.
Then I added a kernel.json (as in #5). Then I can start a gnuplot_kernel, but it dies all the time.
I suspect that it never finds the gnuplot program, but I cannot find the place where it refers to the gnuplot installation. Can you help?
Regards, Michael
It would be good to be able to run the notebooks that demo this kernel via MyBinder.
I'm guessing that if there was a pattern for Binderising one kernel based on Metakernel, it would work for all kernels where a container could be built to include the application being wrapped as a kernel application?
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 Exception
FileNotFoundError: [WinError 2] The system cannot find the file specified
The full traceback:
Traceback (most recent call last):
File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\python36\lib\site-packages\gnuplot_kernel\__main__.py", line 9, in <module>
IPKernelApp.launch_instance(kernel_class=GnuplotKernel)
File "c:\python36\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-124>", line 2, in initialize
File "c:\python36\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "c:\python36\lib\site-packages\ipykernel\kernelapp.py", line 465, in initialize
self.init_kernel()
File "c:\python36\lib\site-packages\ipykernel\kernelapp.py", line 376, in init_kernel
user_ns=self.user_ns,
File "c:\python36\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "c:\python36\lib\site-packages\metakernel\process_metakernel.py", line 54, in __init__
self.wrapper = self.makeWrapper()
File "c:\python36\lib\site-packages\gnuplot_kernel\kernel.py", line 237, in makeWrapper
wrapper = GnuplotREPLWrapper(**d)
File "c:\python36\lib\site-packages\metakernel\replwrap.py", line 66, in __init__
encoding="utf-8")
File "c:\python36\lib\site-packages\metakernel\pexpect.py", line 32, in spawn
encoding=encoding, codec_errors=codec_errors)
File "c:\python36\lib\site-packages\pexpect\popen_spawn.py", line 53, in __init__
self.proc = subprocess.Popen(cmd, **kwargs)
File "c:\python36\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "c:\python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
According to the suggestions in #10 I checked the kernel specs and the kernel.json. The path to python is correct.
import pexpect
pexpect.which('gnuplot')
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
Stupid question maybe but how do you pass a numpy array to gnuplot?
BTW, do you still maintain this project?
Thanks.
Hi, when I tried to run:
plot sin(x)
I get this message:
Failed to read and display image file from gnuplot. Possibly:
It is necessary to set a terminal?
gnuplot_kernel successfully recognizes when there are multiple plot
instructions such as
plot x**0 t "x^0"
plot x**1 t "x^1"
plot x**2 t "x^2"
However, when using for
loops such as
do for [t=0:2] {
plot x**t t sprintf("x^%d",t)
}
this fails and only the last plot is displayed.
Cause:
In the function def add_inline_image_statements(self, code):
in kernel.py the code is scanned for plot statements and for each plot statement a set output
line is added (unless when using multiplot). Thus, each plot in the loop will be written to the same output file, hence overwriting any previous plot. Consequentially, only the last plot is displayed.
Possible fix:
Detect for loops. When a for loop is detected, add a counter variable that is incremented in the loop everytime. Append the counter to the filename for the output file (which should not overwrite previous plots then).
Hi.
The kernel runs fine (macOS, conda) but I get this message after running each cell:
Warning: The prompt is currently set to '2004hgnuplot> '
Out[*]: ?2004l
Thx.
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!
An unknown error occured. Failed to read and display image file from gnuplot.
Out[4]:
Terminal type set to 'unknown'
^
unknown or ambiguous terminal type; type just 'set terminal' for a list
Is it possible to generate graphs with interactivity, so that when you hover a mouse over a value it shows some title-esque tooltip?
https://github.com/kaihendry/covid19-sg/blob/master/gnuplot.ipynb
OS: Centos 7
gnuplot 4.6 patchlevel 2
Python 3.7.6
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 : 1.2.6
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 5.0.4
traitlets : 4.3.3
Keep running into these not well-formed errors of late:
https://s.natalian.org/2020-08-26/invalid.mp4
The notebook is here: https://github.com/kaihendry/covid19-sg/blob/lkyspp-demo/jsdir.ipynb
Greatly enjoying the IDE for gnuplot iterations, however how do I fetch data from a URL?
For example https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/01-22-2020.csv ?
I know how it works in python roughly, but not this kernel.
In a Jupyter notebook, this produces no output, times out after 30s (while the equivalent works fine directly in gnuplot):
%load_ext gnuplot_kernel
%gnuplot inline pngcairo
%%gnuplot
$DATA <<EOD
# x y
0.5 3
0.7 4
1.5 5
2 6
EOD
plot $DATA
stats $DATA
Similar timeout if the entire kernel is set to gnuplot (not magic extension, but the kernel itself).
Installed via
pip install --upgrade --no-cache-dir git+https://github.com/has2k1/gnuplot_kernel.git@master
So I have previously installed the Octave Kernel See here:. Octave Itself comes with an installation of Gnu-Plot for its own plotting purposes. However, some times it is preferable just to be using Gnuplot as Gnuplot, not as a back end.
I currently have Jupyter installed with conda
, not PIP
. but my octave_kernel
is also installed with PIP
, not conda
it works just fine (after i updated metakernel
to 20.4.12
.
Upon downloading the kernel with PIP and installing with jupyter kernelspec install
and running jupyter kernelspec list
I do not see the installed kernel, but the console output is usually
[InstalledKernelSpec] Installed kernelspec gnuplot_kernel in <directory>
whats up?
https://s.natalian.org/2020-08-22/gnuplot.mp4
Keep running into this error. Any ideas why? It's breaking the workflow with Gnuplot...
Tried first with the apt-get install gnuplot_kernel
, later with an install from github. Install reports that all is well, but jupyter
does not see the kernel. The system is up-to-date on the LT release 20.04.
$ sudo pip3 install git+https://github.com/has2k1/gnuplot_kernel.git@master -U
Collecting git+https://github.com/has2k1/gnuplot_kernel.git@master
Cloning https://github.com/has2k1/gnuplot_kernel.git (to revision master) to /tmp/pip-req-build-vbijkgrg
Running command git clone -q https://github.com/has2k1/gnuplot_kernel.git /tmp/pip-req-build-vbijkgrg
...
Successfully built gnuplot-kernel
Installing collected packages: gnuplot-kernel
Attempting uninstall: gnuplot-kernel
Found existing installation: gnuplot-kernel 0.4.1
Uninstalling gnuplot-kernel-0.4.1:
Successfully uninstalled gnuplot-kernel-0.4.1
Successfully installed gnuplot-kernel-0.4.1
$ pip3 list | grep gnuplot
gnuplot-kernel 0.4.1
$ jupyter kernelspec list
Available kernels:
ir /home/XXXX/.local/share/jupyter/kernels/ir
python3 /usr/share/jupyter/kernels/python3
$ uname -a
Linux XXXX 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Any suggestions?
On OSX, using Anaconda as my distribution of python 2, following the instructions does not make gnuplot appear as a notebook type in the Jupyter pull-down menu of notebook types. Did: pip install gnuplot_kernel; no error messages. All requirements met:
metakernel>=0.10.5
notebook>=4.0
IPython>=3.0
pip install went smoothly. Gnuplot is installed and on the path, tests out fine.
Are there any additional instructions on the setup side? Most of the other programs I have paired with Jupyter required starting and setting something internal to them before Jupyter recognized them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.