Replies: 1 comment 1 reply
-
That error means the regular python kernel is executing the code, not the pyscript one. So you need to figure out why the Jupyter notebook isn't starting the right kernel. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Every time I start a Jupyter notebook kernel for some reason throws an error on execution of a ".py" script i have in pyscript:
This file works fine when used by home assistant, but in order to initialzie the kernetl i have to move it to another folder, start the kernel, then move it back to pyscript - after that both kernel and script work....
any thoughts?
SyntaxError: 'async with' outside async function... View Jupyter [log](command:jupyter.viewOutput) for further details. at ChildProcess.<anonymous> (/root/.vscode-server/extensions/ms-toolsai.jupyter-2023.1.2010391206/out/extension.node.js:17:102857) at ChildProcess.emit (node:events:538:35) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) { category: 'kerneldied', kernelConnectionMetadata: Qd { kind: 'startUsingLocalKernelSpec', kernelSpec: { specFile: '/root/.local/share/jupyter/kernels/pyscript/kernel.json', name: 'undefined.hass_pyscript_kernel', argv: [Array], language: 'python', executable: 'python3', display_name: 'hass pyscript', metadata: [Object] }, interpreter: undefined, id: '.undefined.hass_pyscript_kernel./python3./.-m#hass_pyscript_kernel' }, exitCode: 1, stdErr: 'Traceback (most recent call last):\n' + ' File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main\n' + ' mod_name, mod_spec, code = _get_module_details(mod_name, _Error)\n' + ' File "/usr/lib/python3.9/runpy.py", line 147, in _get_module_details\n' + ' return _get_module_details(pkg_main_name, error)\n' + ' File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details\n' + ' __import__(pkg_name)\n' + ' File "/usr/local/lib/python3.9/dist-packages/hass_pyscript_kernel/__init__.py", line 3, in <module>\n' + ' from .install import install_main\n' + ' File "/usr/local/lib/python3.9/dist-packages/hass_pyscript_kernel/install.py", line 11, in <module>\n' + ' from .shim import CONFIG_SETTINGS, PKG_NAME, load_config\n' + ' File "/usr/local/lib/python3.9/dist-packages/hass_pyscript_kernel/shim.py", line 23, in <module>\n' + ' import aiohttp\n' + ' File "/usr/local/lib/python3.9/dist-packages/aiohttp/__init__.py", line 6, in <module>\n' + ' from .client import (\n' + ' File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 36, in <module>\n' + ' from . import hdrs, http, payload\n' + ' File "/usr/local/lib/python3.9/dist-packages/aiohttp/http.py", line 1, in <module>\n' + ' import http.server\n' + ' File "/usr/lib/python3.9/http/server.py", line 92, in <module>\n' + ' import email.utils\n' + ' File "/usr/lib/python3.9/email/utils.py", line 33, in <module>\n' + ' from email._parseaddr import quote\n' + ' File "/usr/lib/python3.9/email/_parseaddr.py", line 16, in <module>\n' + ' import time, calendar\n' + ' File "/usr/share/hassio/homeassistant/pyscript/calendar.py", line 27\n' + ' async with aiohttp.ClientSession(headers=headers, connector=aiohttp.TCPConnector(ssl=False)) as session:\n' + ' ^\n' + "SyntaxError: 'async with' outside async function\n" }
Beta Was this translation helpful? Give feedback.
All reactions