Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues running the kernel #14

Open
jdenver13 opened this issue Mar 31, 2021 · 2 comments
Open

Issues running the kernel #14

jdenver13 opened this issue Mar 31, 2021 · 2 comments

Comments

@jdenver13
Copy link

After installing on my Mac, I cant get the hass-pyscript-jupyter to work
Running 'jupyter kernelspec list':

[ListKernelSpecs] WARNING | Native kernel (python3) is not available
[ListKernelSpecs] WARNING | Native kernel (python3) is not available
Available kernels:
  pyscript    /usr/local/share/jupyter/kernels/pyscript

Running 'jupyter pyscript info':

hass_pyscript_kernel version 1.0.0 installed
Kernel pyscript installed in /usr/local/share/jupyter/kernels/pyscript
Config settings from /usr/local/share/jupyter/kernels/pyscript/pyscript.conf:
    hass_host = 192.168.1.63
    hass_url = http://192.168.1.63:8123
    hass_token = 6MTYxNzE5MDI1OSwiZXhwIjoxOTMyNTUwyoPnHd8vvF0upJAKRCzsek
    hass_proxy = None

If I run 'juptyer notebook', all seems ok:

[I 2021-03-31 13:42:38.768 LabApp] JupyterLab extension loaded from /usr/local/Cellar/jupyterlab/3.0.12/libexec/lib/python3.9/site-packages/jupyterlab
[I 2021-03-31 13:42:38.769 LabApp] JupyterLab application directory is /usr/local/Cellar/jupyterlab/3.0.12/libexec/share/jupyter/lab
[I 13:42:38.776 NotebookApp] Serving notebooks from local directory: /Users/denver
[I 13:42:38.777 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 13:42:38.777 NotebookApp] http://localhost:8888/?token=8c639d693d8f0
[I 13:42:38.777 NotebookApp]  or http://127.0.0.1:8888/?token=8c639d693d8f0
[I 13:42:38.777 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:42:38.781 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///Users/denver/Library/Jupyter/runtime/nbserver-4284-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=8c639d693d8f0
     or http://127.0.0.1:8888/?token=8c639d693d8f0

If I then select 'hass pyscript' in Jupyter notebooks 'New' menu I get:

[I 18:46:35.274 NotebookApp] Creating new notebook in 
[I 18:46:36.394 NotebookApp] Kernel started: 5f607b3a-3390-4b7c-bc5b-939c3f47782d, name: pyscript
[W 18:46:36.442 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20210331184622 (::1) 28.070000ms referer=http://localhost:8888/notebooks/Untitled4.ipynb?kernel_name=pyscript
/usr/local/Cellar/jupyterlab/3.0.12/libexec/bin/python3.9: No module named hass_pyscript_kernel
[I 18:46:39.380 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
/usr/local/Cellar/jupyterlab/3.0.12/libexec/bin/python3.9: No module named hass_pyscript_kernel
[I 18:46:42.389 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
/usr/local/Cellar/jupyterlab/3.0.12/libexec/bin/python3.9: No module named hass_pyscript_kernel
[I 18:46:45.400 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
/usr/local/Cellar/jupyterlab/3.0.12/libexec/bin/python3.9: No module named hass_pyscript_kernel
[I 18:46:48.413 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
/usr/local/Cellar/jupyterlab/3.0.12/libexec/bin/python3.9: No module named hass_pyscript_kernel
[W 18:46:51.422 NotebookApp] KernelRestarter: restart failed
[W 18:46:51.423 NotebookApp] Kernel 5f607b3a-3390-4b7c-bc5b-939c3f47782d died, removing from map.
[W 18:47:36.469 NotebookApp] Timeout waiting for kernel_info reply from 5f607b3a-3390-4b7c-bc5b-939c3f47782d
[E 18:47:36.472 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 5f607b3a-3390-4b7c-bc5b-939c3f47782d)

Any ideas where to go from here or what to try please.

@rhtenhove
Copy link

Came across the same problem. The kernelspec refers to python as the python binary to use, but it's not using the one which the shell points to when in a virtualenv. Not sure if this is a problem with jupyter or with this tool.

This can be 'fixed' by setting the binary to the one which has access to the hass_pyscript_kernel module.

  1. Run jupyter kernelspec list
  2. Open the file kernel.json in the folder which is listed next to pyscript in the previous command's output
  3. Change python in argv to whatever comes out of which python when running that in your virtualenv

On to the next problem, connection refused... 😞

@Quadrubo
Copy link

Any update on this? I also have this problem. HTTP 400, 401 and 403s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants