Giter Club home page Giter Club logo

Comments (12)

has2k1 avatar has2k1 commented on July 20, 2024 1

That last install did not do anything. Try forcing a reinstall.

pip uninstall gnuplot_kernel
pip install --upgrade --no-cache-dir git+https://github.com/has2k1/gnuplot_kernel.git@osx-install

from gnuplot_kernel.

has2k1 avatar has2k1 commented on July 20, 2024

I do not have access to OSX, so I am going by the documentation here. Do you have anything in the following directories?

ls -l ~/Library/Jupyter
ls -l ~/Library/Jupyter/kernels

from gnuplot_kernel.

mdtdev avatar mdtdev commented on July 20, 2024

Well that is interesting. I have the following in those directories:

ls -l ~/Library/Jupyter:

drwxr-xr-x  4 mdt  staff    136 Feb 22 20:51 kernels/
-rw-r--r--  1 mdt  staff  65536 Feb 27 18:18 nbsignatures.db
-rw-------  1 mdt  staff   1386 Nov 18 13:06 notebook_cookie_secret
-rw-------  1 mdt  staff   1386 Nov 18 13:06 notebook_secret
drwx------  8 mdt  staff    272 Feb 27 17:54 runtime/

ls -l ~/Library/Jupyter/kernels:

drwxr-xr-x  4 mdt  staff  136 Feb 22 01:02 ir/
drwxr-xr-x  5 mdt  staff  170 Feb 22 20:51 julia-0.4/

However, I am thinking the problem may be with my use of the Anaconda distribution as it keeps a \share folder in its filespace as well. That is in the folder ls -l ~/anaconda/share/jupyter/ which also contains a kernels subfolder.

$ ls -l ~/anaconda/share/jupyter/kernels/
total 0
drwxr-xr-x  4 mdt  staff  136 Feb 27 00:04 ir/

I am not even remotely an expert on Jupyter notebooks, but I am assuming that Python is native (hence no kernel in either location). The ir and julia-0.4 kernels (in ~/Library/Jupyter/kernels) I installed manually a week or so ago.

The ir kernel in the ~/anaconda/share/jupyter/kernels/ folder was installed by Anaconda's conda package manager as part of a test of Anaconda's support for basic R (See also here.) I did that test today. I just discovered this so I have not yet been able to determine which of the ir kernels is actually used and when.

So this could be due to Anaconda, something OSX-ey, or maybe I messed something up previously.

What should I see in the kernel's directory? Should the gnuplot_kernel show up in that list as a directory there? I installed it using pip as there is currently no support for installs with the conda package manager.

PS: searching my Anaconda install, I found a directory gnuplot_kernel in the folder:

/Users/mdt/anaconda/lib/python2.7/site-packages

and it had the following contents (apparently the Anaconda site-packages directory is at the location above, and that is where Anaconda's pip stuck gnuplot_kernel):

$ ls ~/anaconda/lib/python2.7/site-packages/gnuplot_kernel
__init__.py __main__.pyc    images/     magics/     tests/
__init__.pyc    exceptions.py   kernel.py   replwrap.py
__main__.py exceptions.pyc  kernel.pyc  replwrap.pyc

Hope that clarifies something! Thanks for any help!

from gnuplot_kernel.

has2k1 avatar has2k1 commented on July 20, 2024

Can you try out another install (below) and see whether & where it gets installed.

pip install metakernel_python --update

ls -l ~/Library/Jupyter/kernels
ls -l ~/anaconda/share/jupyter/kernels/

from gnuplot_kernel.

mdtdev avatar mdtdev commented on July 20, 2024

My pip does not like --update but assuming you wanted --upgrade then:

$ pip install --upgrade  metakernel_python
Collecting metakernel-python
  Downloading metakernel_python-0.11.3.tar.gz
Requirement already up-to-date: metakernel in ./anaconda/lib/python2.7/site-packages (from metakernel-python)
Requirement already up-to-date: jedi in ./anaconda/lib/python2.7/site-packages (from metakernel-python)
Requirement already up-to-date: IPython>=3.0 in ./anaconda/lib/python2.7/site-packages (from metakernel->metakernel-python)
Building wheels for collected packages: metakernel-python
  Running setup.py bdist_wheel for metakernel-python ... done
  Stored in directory: /Users/mdt/Library/Caches/pip/wheels/4b/10/2e/71a8cd506c8a11fb871dffaad0e8acf99cd2920d2a71bf9051
Successfully built metakernel-python
Installing collected packages: metakernel-python
Successfully installed metakernel-python-0.11.3

and:

$ ls -l ~/Library/Jupyter/kernels
total 0
drwxr-xr-x  4 mdt  staff  136 Feb 22 01:02 ir/
drwxr-xr-x  5 mdt  staff  170 Feb 22 20:51 julia-0.4/

and finally:

$ ls -l ~/anaconda/share/jupyter/kernels/
total 0
drwxr-xr-x  4 mdt  staff  136 Feb 27 00:04 ir/

No joy. Also, now there is a metakernel python option in my Jupyter pull-down menu:

jupyter_pull_down

from gnuplot_kernel.

has2k1 avatar has2k1 commented on July 20, 2024

There is secret kernels directory somewhere. The Jupyter clients look in the kernels directory(ies) to known which kernels are available and how to start them.

Tryout this potential fix

pip install git+https://github.com/has2k1/gnuplot_kernel.git@osx-install

It installs using the pull request (#2) branch.

from gnuplot_kernel.

has2k1 avatar has2k1 commented on July 20, 2024

To help sniff out that other kernels directory, can you try this out.

Open a new notebook and run these commands in a cell

from jupyter_client.kernelspec import KernelSpecManager
ksm = KernelSpecManager()
ksm.find_kernel_specs()

from gnuplot_kernel.

mdtdev avatar mdtdev commented on July 20, 2024

Ok, I'll try the second thing first. Upon running:

from jupyter_client.kernelspec import KernelSpecManager
ksm = KernelSpecManager()
ksm.find_kernel_specs()

the result is:

{'ir': '/Users/mdt/Library/Jupyter/kernels/ir',
 'julia-0.4': '/Users/mdt/Library/Jupyter/kernels/julia-0.4',
 'metakernel_python': '/usr/local/share/jupyter/kernels/metakernel_python',
 'python2': '/Users/mdt/anaconda/lib/python2.7/site-packages/ipykernel/resources'}

This is under the previous attempts, before trying the install from github. The ir and julia installs make sense as I did those manually under a previous python setup. The metakernel_python is what happened when I followed your instructions using pip. I am surprised by this as I thought Anaconda's pip would default to installing things in the Anaconda filespace and that programs there would be appropriately directed to prefixes in there. So that one was secret. 😄 The python2 was prebuilt for Anaconda. Also not a location I expected to see.

from gnuplot_kernel.

mdtdev avatar mdtdev commented on July 20, 2024

Trying: pip install git+https://github.com/has2k1/gnuplot_kernel.git@osx-install the output is similar to what we got before:

Collecting git+https://github.com/has2k1/gnuplot_kernel.git@osx-install
  Cloning https://github.com/has2k1/gnuplot_kernel.git (to osx-install) to /var/folders/l_/4h1b3fgd4xz99v5xv60lr7kh0000gn/T/pip-x6rqjs-build
  Requirement already satisfied (use --upgrade to upgrade): gnuplot-kernel==0.2.0 from git+https://github.com/has2k1/gnuplot_kernel.git@osx-install in ./lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): metakernel>=0.10.5 in ./lib/python2.7/site-packages (from gnuplot-kernel==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): notebook>=4.0 in ./lib/python2.7/site-packages (from gnuplot-kernel==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): IPython>=3.0 in ./lib/python2.7/site-packages (from metakernel>=0.10.5->gnuplot-kernel==0.2.0)

So basically it seems to say that the requirements are met...

Which of the Jupyter directories is gnuplot_kernel supposed to be in on a more usual Python install?

from gnuplot_kernel.

has2k1 avatar has2k1 commented on July 20, 2024

I expect gnuplot_kernel to install in the same location as metakernel_python. For your case, that should be /usr/local/share/jupyter/kernels/.

from gnuplot_kernel.

mdtdev avatar mdtdev commented on July 20, 2024

Haha. I was just trying that. It appears to have worked!

For reference:

from jupyter_client.kernelspec import KernelSpecManager
ksm = KernelSpecManager()
ksm.find_kernel_specs()

now gives:

{'gnuplot': '/usr/local/share/jupyter/kernels/gnuplot',
 'ir': '/Users/mdt/Library/Jupyter/kernels/ir',
 'julia-0.4': '/Users/mdt/Library/Jupyter/kernels/julia-0.4',
 'metakernel_python': '/usr/local/share/jupyter/kernels/metakernel_python',
 'python2': '/Users/mdt/anaconda/lib/python2.7/site-packages/ipykernel/resources'}

which is where you expected things to end up.

Thanks for all the help! I am very excited to have gnuplot in a notebook. 👍

from gnuplot_kernel.

has2k1 avatar has2k1 commented on July 20, 2024

Great. Thanks for the debugging.

from gnuplot_kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.