Interestingly, the error does not reference the package, nor any of its dependencies. The error trace goes from the micromamba build library to jupyterlite_core/manager
> jupyterlite_xeus/add_on
> empack/pack
and then to the Pyhon JSON decoder.
Build Log
Transaction finished
To activate this environment, use:
micromamba activate xeus-python-kernel
Or to execute a single command in this environment, use:
micromamba run -n xeus-python-kernel mycommand
[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus] [ERR] Object of type PosixPath is not JSON serializable
Traceback (most recent call last):
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/doit_cmd.py", line 294, in run
return command.parse_execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/cmd_base.py", line 150, in parse_execute
return self.execute(params, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/cmd_base.py", line 570, in execute
return self._execute(**exec_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/cmd_run.py", line 265, in _execute
return runner.run_all(self.control.task_dispatcher())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/runner.py", line 254, in run_all
self.run_tasks(task_dispatcher)
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/runner.py", line 213, in run_tasks
node = task_dispatcher.generator.send(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/control.py", line 629, in _dispatcher_generator
next_step = node.step()
^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/control.py", line 336, in step
return next(self.generator)
^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/control.py", line 345, in _func
for value in decorated(*args, **kwargs):
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/control.py", line 473, in _add_task
new_tasks = generate_tasks(to_load, task_gen, ref.doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/loader.py", line 390, in generate_tasks
for task_dict, x_doc in flat_generator(gen_result, gen_doc):
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/doit/loader.py", line 27, in flat_generator
for item in gen:
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_core/manager.py", line 138, in _delayed_gather
yield from _gather()
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_core/manager.py", line 131, in _gather
raise error
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_core/manager.py", line 123, in _gather
for task in getattr(addon, attr)(self):
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_xeus/add_on.py", line 127, in post_build
yield from self.copy_kernels_from_prefix()
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_xeus/add_on.py", line 179, in copy_kernels_from_prefix
yield from self.copy_kernel(kernel_dir, kernel_wasm, kernel_js)
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_xeus/add_on.py", line 261, in copy_kernel
yield from self.pack_prefix(kernel_dir=kernel_dir)
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/jupyterlite_xeus/add_on.py", line 288, in pack_prefix
pack_env(
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/empack/pack.py", line 186, in pack_env
pack_pkg_impl(
File "/home/runner/micromamba/envs/build-env/lib/python3.11/site-packages/empack/pack.py", line 54, in pack_pkg_impl
json.dump(pkg_meta, f)
File "/home/runner/micromamba/envs/build-env/lib/python3.11/json/init.py", line 179, in dump
for chunk in iterable:
File "/home/runner/micromamba/envs/build-env/lib/python3.11/json/encoder.py", line 432, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/home/runner/micromamba/envs/build-env/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/home/runner/micromamba/envs/build-env/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
yield from chunks
File "/home/runner/micromamba/envs/build-env/lib/python3.11/json/encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "/home/runner/micromamba/envs/build-env/lib/python3.11/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type PosixPath is not JSON serializable
Problem
Currently the navbar in the documentation takes two lines, and the layout looks off:
Suggested Improvement
It would be nice to make it look better, maybe with a config option if available, by changing the names of the sections, or by tweaking the CSS.
In https://xeus-python-kernel.readthedocs.io/en/latest/configuration.html, it says that: "You can also install a local Python package, this is very practical if you want to embed a jupyterlite deployment in your Package documentation, allowing to test the very latest dev version:
name: xeus-python-kernel
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge
dependencies:
- pip:
- .."
If I want to install a wheel named "a.wheel", it seems the following YAML works
dependencies:
- pip:
- "./a.wheel"
To install wheels of a folder named b, it seems the following YAML does not work.
dependencies:
- pip:
- "./b/*.wheel"
I am wondering what is the right way to do so.
I believe mounts as a List
where better than comma-separated strings.
with lists I could do the following for three relatively long mounts
jupyter lite build \
--XeusAddon.prefix=$XEUS_PYTHON_WASM_ENV_PREFIX
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/python3.11/site-packages/nxtgm:/lib/python3.11/site-packages/nxtgm"
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/nxtgm/__extra__/:/lib/"
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/nxtgm/plugins:/lib/nxtgm/plugins"
With the comma separated this looks like the follwoing (horrible)
jupyter lite build \
--XeusAddon.prefix=$XEUS_PYTHON_WASM_ENV_PREFIX
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/python3.11/site-packages/nxtgm:/lib/python3.11/site-packages/nxtgm,XeusAddon.mounts="$WASM_ENV_PREFIX/lib/nxtgm/__extra__/:/lib/,$WASM_ENV_PREFIX/lib/nxtgm/plugins:/lib/nxtgm/plugins"
So to make this somewhat sane with the comma-separated list I have to introduce some variables
and call it with the variables.
MOUNT_PYTHON_PKG="$WASM_ENV_PREFIX/lib/python3.11/site-packages/nxtgm:/lib/python3.11/site-packages/nxtgm"
MOUNT_LIBNXTGM="$WASM_ENV_PREFIX/lib/nxtgm/__extra__/:/lib/"
MOUNT_NXTGM_PLUGINS="$WASM_ENV_PREFIX/lib/nxtgm/plugins:/lib/nxtgm/plugins"
# jupyterlite
jupyter lite build \
--XeusAddon.prefix=$XEUS_PYTHON_WASM_ENV_PREFIX \
--XeusAddon.mounts=$MOUNT_PYTHON_PKG,$MOUNT_LIBNXTGM,$MOUNT_NXTGM_PLUGINS
I suggest using a list of strings, and each entry can be comma-separated.
That way we get the best of both worlds
Would it be possible to get the module sspyrs working, or a replacement ?
If I put it or its requirement requests-ntlm in the "environment.yml", the build fails.
... yet "requets" seems to be there
# requests works in jupyterlite/xeus-python-demo !
import requests
from datetime import date, timedelta, datetime
today = date.today()
yesterday = today - timedelta(days=10)
country = "germany"
endpoint = f"https://api.covid19api.com/country/{country}/status/confirmed"
params = {"from": str(yesterday), "to": str(today)}
print(params)
endpoint_via_browser = f"https://api.covid19api.com/country/germany/status/confirmed?from=2022-12-06&to=2022-12-22"
response = requests.get(endpoint, params=params).json()
total_confirmed = 0
for day in response:
date_python = datetime.fromisoformat(day.get("Date", 0)[:-1] + '+00:00')
print(date_python.strftime('%Y-%m-%d'), f'{day.get("Cases", 0):_.0f}')
cases = day.get("Cases", 0)
total_confirmed += cases
print(f"Total Confirmed Covid-19 cases in {country}: {total_confirmed:_.0f}")
For both Xeus-Javascript and Xeus-Python kernel, in all newly created notebooks, syntax highlights were gone in code cells. While P5.js kernel has no such issue.
A description in detail can be found at: jupyter-xeus/xeus-javascript#34.
Most likely there is a bug in Xeus.
Please check.
Thanks,
Problem
Currently there are quite a few messages in the dev tools console when starting a kernel:
These messages can add a bit of noise and some deployments might want to silent them.
Proposed Solution
- Provide an option to disable the logs
- Show the logs by default or not?
Additional context
Testing with:
jupyterlite-xeus-python
0.9.0
empack
3.0.0
Description
Not technically related to jupyterlite-xeus, but I think we should fix it before releasing the 0.1.0 and replacing jupyterlite-xeus-python, hence opening it here.
This may require a fix in xeus-python, or an ugly patch of the kernel spec in emscripten-forge/recipes
There are some kernels providing an SVG icon as part of their kernel spec. We should make use of it when available.
Is there any way for a user to installing additional packages from pip into a running xeus-python
kernel?
When not having an environment.yml
file around, the error Either prefix or environment_file must be set
shows up, not giving any clue to the user what to do next. We should provide solutions like:
"Either a prefix or an environment_file must be provided for jupyterlite-xeus. You should try to create an environment.yml file in the location where you build the JupyterLite site. See https://jupyterlite-xeus.readthedocs.io/en/latest/environment.html for examples."
Description
urllib
can't handle https URLs in XPython kernel.
A similar issue was reported for Pyodide kernel (jupyterlite/jupyterlite#413), but the proposed solution is Pyodide specific.
Reproduce
Using xeus-python-kernel, try to execute a cell:
import pandas as pd
pd.read_csv('https://raw.githubusercontent.com/jupyterlite/jupyterlite/main/examples/data/iris.csv')
You will get the error: <urlopen error unknown url type: https>
Detailed error report shows the exception is raised inside the urllib
module.
Expected behavior
The referenced CSV file should be loaded into a data frame.
Context
- JupyterLite version: latest
- Operating System and version: Win 10
- Browser and version: Chrome, latest
- jupyter_lite_config.json:
{
"XeusPythonEnv": {
"packages": ["openpyxl","pandas","matplotlib","openssl","pyopenssl"]
},
"LiteBuildConfig": {
"contents": ["_contents"]
}
}
Error traceback
---------------------------------------------------------------------------
URLError Traceback (most recent call last)
Input In [3], in ()
----> 1 pd.read_csv('https://raw.githubusercontent.com/jupyterlite/jupyterlite/main/examples/data/iris.csv')
File /lib/python3.10/site-packages/pandas/util/_decorators.py:311, in deprecate_nonkeyword_arguments..decorate..wrapper(*args, **kwargs)
305 if len(args) > num_allow_args:
306 warnings.warn(
307 msg.format(arguments=arguments),
308 FutureWarning,
309 stacklevel=stacklevel,
310 )
--> 311 return func(*args, **kwargs)
File /lib/python3.10/site-packages/pandas/io/parsers/readers.py:680, in read_csv(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)
665 kwds_defaults = _refine_defaults_read(
666 dialect,
667 delimiter,
(...)
676 defaults={"delimiter": ","},
677 )
678 kwds.update(kwds_defaults)
--> 680 return _read(filepath_or_buffer, kwds)
File /lib/python3.10/site-packages/pandas/io/parsers/readers.py:575, in _read(filepath_or_buffer, kwds)
572 _validate_names(kwds.get("names", None))
574 # Create the parser.
--> 575 parser = TextFileReader(filepath_or_buffer, **kwds)
577 if chunksize or iterator:
578 return parser
File /lib/python3.10/site-packages/pandas/io/parsers/readers.py:933, in TextFileReader.init(self, f, engine, **kwds)
930 self.options["has_index_names"] = kwds["has_index_names"]
932 self.handles: IOHandles | None = None
--> 933 self._engine = self._make_engine(f, self.engine)
File /lib/python3.10/site-packages/pandas/io/parsers/readers.py:1217, in TextFileReader._make_engine(self, f, engine)
1213 mode = "rb"
1214 # error: No overload variant of "get_handle" matches argument types
1215 # "Union[str, PathLike[str], ReadCsvBuffer[bytes], ReadCsvBuffer[str]]"
1216 # , "str", "bool", "Any", "Any", "Any", "Any", "Any"
-> 1217 self.handles = get_handle( # type: ignore[call-overload]
1218 f,
1219 mode,
1220 encoding=self.options.get("encoding", None),
1221 compression=self.options.get("compression", None),
1222 memory_map=self.options.get("memory_map", False),
1223 is_text=is_text,
1224 errors=self.options.get("encoding_errors", "strict"),
1225 storage_options=self.options.get("storage_options", None),
1226 )
1227 assert self.handles is not None
1228 f = self.handles.handle
File /lib/python3.10/site-packages/pandas/io/common.py:670, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
667 codecs.lookup_error(errors)
669 # open URLs
--> 670 ioargs = _get_filepath_or_buffer(
671 path_or_buf,
672 encoding=encoding,
673 compression=compression,
674 mode=mode,
675 storage_options=storage_options,
676 )
678 handle = ioargs.filepath_or_buffer
679 handles: list[BaseBuffer]
File /lib/python3.10/site-packages/pandas/io/common.py:339, in _get_filepath_or_buffer(filepath_or_buffer, encoding, compression, mode, storage_options)
337 # assuming storage_options is to be interpreted as headers
338 req_info = urllib.request.Request(filepath_or_buffer, headers=storage_options)
--> 339 with urlopen(req_info) as req:
340 content_encoding = req.headers.get("Content-Encoding", None)
341 if content_encoding == "gzip":
342 # Override compression based on Content-Encoding header
File /lib/python3.10/site-packages/pandas/io/common.py:239, in urlopen(*args, **kwargs)
233 """
234 Lazy-import wrapper for stdlib urlopen, as that imports a big chunk of
235 the stdlib.
236 """
237 import urllib.request
--> 239 return urllib.request.urlopen(*args, **kwargs)
File /lib/python3.10/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
214 else:
215 opener = _opener
--> 216 return opener.open(url, data, timeout)
File /lib/python3.10/urllib/request.py:519, in OpenerDirector.open(self, fullurl, data, timeout)
516 req = meth(req)
518 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 519 response = self._open(req, data)
521 # post-process response
522 meth_name = protocol+"_response"
File /lib/python3.10/urllib/request.py:541, in OpenerDirector._open(self, req, data)
538 if result:
539 return result
--> 541 return self._call_chain(self.handle_open, 'unknown',
542 'unknown_open', req)
File /lib/python3.10/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
494 for handler in handlers:
495 func = getattr(handler, meth_name)
--> 496 result = func(*args)
497 if result is not None:
498 return result
File /lib/python3.10/urllib/request.py:1419, in UnknownHandler.unknown_open(self, req)
1417 def unknown_open(self, req):
1418 type = req.type
-> 1419 raise URLError('unknown url type: %s' % type)
URLError: <urlopen error unknown url type: https>
If there is no kernel installed, the extension fails with:
File "/home/runner/micromamba/envs/build-env/lib/python3.12/pathlib.py", line 1056, in iterdir
for name in os.listdir(self):
^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp2ay0_eyo/env/envs/xeus-env/share/jupyter/kernels'
It would be nice to have a nice user-friendly message instead.
Lint the Python code with ruff
Problem
Currently the default channels are only added if there is no environment file:
|
# open the env yaml file if it's provided |
|
if env_file.exists(): |
|
with open(env_file, "r") as file: |
|
yaml_content = yaml.safe_load(file) |
|
|
|
env_name = yaml_content.get("name", "xeus-env") |
|
|
|
env_prefix = root_prefix / "envs" / env_name |
|
self.prefix = str(env_prefix) |
|
|
|
create_conda_env_from_env_file(root_prefix, yaml_content, env_file.parent) |
|
else: |
|
create_conda_env_from_specs( |
|
env_name=env_name, |
|
root_prefix=root_prefix, |
|
specs=["xeus-python"], |
|
channels=["https://repo.mamba.pm/emscripten-forge", "conda-forge"], |
|
) |
Proposed Solution
Maybe the add-on should check if the user-provided environment.yml
includes https://repo.mamba.pm/emscripten-forge in the list of channels
, and add it automatically otherwise?
Additional context
This could help improving compatibility with existing environment.yml
files without having to create a copy of the file with https://repo.mamba.pm/emscripten-forge in it.
And also for use cases such as repo2jupyterlite
: jupyterlite/repo2jupyterlite#19
Problem
atm the empack filtering configuration is not exposed to the end-user
Proposed Solution
Do the same as xeus-python-kernel did
Additional context
As a follow-up to #87, we should check if it's possible to test accessing the contents with the new approach via the SharedArrayBuffer
.
Maybe by using an addition server via the Playwright webServer
config section, with a server that enables the COOP / COEP headers:
|
webServer: [ |
|
{ |
|
command: 'yarn start', |
|
port: 8000, |
|
timeout: 120 * 1000, |
|
reuseExistingServer: true |
|
} |
|
] |
Description
With sympy_plot_backends
I create an interactive plot that shows the graph of a parameter dependent function. With a slider it is possible to change the parameter value. After changing the slider value, the plot should be updated. In sympy_plot_backends
interactive matplotlib is used.
With pyodide-kernel
for jupyterlite this feature is working as expected. With xeus-python
there is a glitch: After changing the slider value, the graph is not directly updated. As soon as I click into the drawing pane, the graph gets updated.
Reproduce
Execute the following code in a notebook:
import sympy
%matplotlib widget
import spb
x = sympy.Symbol('x', real=True)
a = sympy.Symbol('a', real=True)
f = sympy.cos(x)/(x**2 + 1)
spb.plot(
f.subs(x, x-a),
params = {
a: (0, -5, 5)
}
)
- Now change the slider value for
a
from the default 0.0
to something nonzero.
- Observe that the plot does not change.
- Click into the plot.
- Observe that now the plot has been updated as expected.
Expected behavior
The plot should update without clicking into the plot pane. With pyodide
kernel it is working as expected.
Context
Xeus Python Environment file:
name: xeus-python-kernel
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge
dependencies:
- ipympl
- matplotlib
- numpy
- sympy
- sympy_plot_backends
- JupyterLite version: 0.2.1
- Operating System and version: OS X
- Browser and version: Chrome 120.0.6099.71 and Safari 17.2 (19617.1.17.11.9)
Description
I have a Python package which includes package data, to be accessed
through importlib.resources
. However, within jupyterlite, importlib.resources
fails do find the data.
Reproduce
-
Clone https://github.com/jupyterlite/xeus-python-demo
-
Add these dependencies to environment.yml
- pip
- pip:
- "git+https://gitlab.dsi.universite-paris-saclay.fr/nicolas.thiery/Laby.git"
-
Build JupyterLite
mamba env create --force -f build-environment.yml
conda activate build-env
cp README.md content
jupyter lite build --contents content --output-dir dist
-
Check the log, and notice the copying of the package data when building the wheel:
creating build/bdist.linux-x86_64/wheel/laby/resources/tiles_png
copying build/lib/laby/resources/tiles_png/nweb.png -> build/bdist.linux-x86_64/wheel/laby/resources/tiles_png
...
-
Browse dist/extensions/@jupyterlite/xeus-python-kernel/static/laby_python-0.0.5-pip.tar.gz
Expected behavior: the archive contain the package data.
Got: the package contains only the Python code
-
Run JupyterLite and from a python kernel run:
tiles_dir = importlib.resources.files("laby").joinpath("resources", "tiles_png")
list(tiles_dir.glob("*"))
Expected behavior: a list of files including 'nweb.png`.
Got: the empty list
Context
- JupyterLite version: 0.1.2
- Operating System and version: Ubuntu 22.04
- Browser and version: Firefox/chromium
Description
a pip installed jupyterlite-xeus does not yield a xeus-python with a proper logo.
Xeus python is installed with micromamba and and xeus-lite is build with the prefix
option.
This is very likely related to #36
Console says:
logo-svg.svg:1 Failed to load resource: the server responded with a status of 404 (File not found)
#2 keeps "noImplicitAny": false
for now, but it should ideally be re-enabled.
Description
getJson
helper is using XMLHttpRequest
synchronously, which is deprecated and does not work well with service worker. Is there any technical season to avoid async call here or can we convert this function to use fetch
?
|
|
|
function getJson(url: string) { |
|
const json_url = URLExt.join(PageConfig.getBaseUrl(), url); |
|
const xhr = new XMLHttpRequest(); |
|
xhr.open('GET', json_url, false); |
|
xhr.send(null); |
Problem
Currently there is no easy way to build the documentation locally.
Suggested Improvement
- Add scripts to build the documentation. For example similar to:
https://github.com/voila-dashboards/voila/blob/5aa861dc153215c66d8ccdff040f4ac868d7af3a/pyproject.toml#L145-L151
[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.docs.scripts]
build = "sphinx-build -W -b html docs docs/build/html"
watch = "sphinx-autobuild -W -b html docs docs/build/html --host 0.0.0.0"
serve = "python -m http.server --directory docs/build/html"
- Add a section to the contributing guide about contributing to the documentation
Description
This may not be the problem with jupyterlite-xeus,
If I try to open a file with a path that contains Unicode characters, such as open('あ')
, I get a UnicodeEncodeError.
Reproduce
- Go to https://jupyterlite-xeus.readthedocs.io/en/latest/
- execute
open('あ')
- UnicodeEncodeError: 'ascii' codec can't encode character '\u3042' in position 14: ordinal not in range(128)
Context
import locale
locale.getencoding()
> 'ASCII'
Unlike pyodide, the result of locale.getencoding() is 'ASCII', so if I could set the locale somewhere, it would solve the problem.
Is the locale
in empack or conda env affecting it?
A follow up on jupyterlite/pyodide-kernel#96
Description
I tried xeus because adding additional pkgs seems far easier then in pyodide. But I ran into issues with network requests.
Reproduce
Using fetch seems to work in principle but gave me this error:
import js
import json
json.loads(await (await js.fetch("http://localhost:8000/jupyter/lab/jupyter-lite.json")).text())
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File /lib/python3.11/site-packages/IPython/__init__.py:44, in patch_asyncio.<locals>.asyncio_call(self, coro)
41 task.add_done_callback(done_cb)
43 raw_js_py_callback = pyjs.JsValue(py_callback)
---> 44 js_py_callback = raw_js_py_callback['__usafe_void_val_val__'].bind(raw_js_py_callback)
45 js_promise = pyjs.js.Promise.new(js_py_callback)
47 pyjs.js.globalThis.toplevel_promise = js_promise
AttributeError: has no attribute/key __usafe_void_val_val__
Then I tried httpx
which seems to require openssl (I added it to my environment.yml). This made the kernel unusable with the condole error: LinkError: WebAssembly.instantiate(): Import #92 module="env" function="time": imported function does not match the expected type
. Complete output below.
I can confirm that requests
lib works but I could not test it with https so far.
Context
- JupyterLite version: 0.2.3
- Operating System and version: debian bookworm
- Browser and version: Chrome, Version 122.0.6261.111 (Official Build) (64-bit)
Browser Output
870.1260b274e8c70c25…0b274e8c70c25c3c4:2 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #92 module="env" function="time": imported function does not match the expected type
| deserialize | @ | 870.1260b274e8c70c25…0b274e8c70c25c3c4:2
-- | -- | -- | --
| S | @ | 870.1260b274e8c70c25…0b274e8c70c25c3c4:2
| Promise.then (async) | |
| apply | @ | 870.1260b274e8c70c25…0b274e8c70c25c3c4:2
| h | @ | 413.df2804f5ae3431aa…804f5ae3431aa4c17:1
| create | @ | 413.df2804f5ae3431aa…804f5ae3431aa4c17:1
| startNew | @ | kernels.js:123
| startNew | @ | sessions.js:105
| (anonymous) | @ | index.js:366
| route | @ | router.js:85
| await in route (async) | |
| fetch | @
ia-expanded="true" tabindex="-1" style="box-sizing: border-box; min-width: 0px; min-height: 0px; flex: 0 0 auto;">
870.1260b274e8c70c25…0b274e8c70c25c3c4:2 Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #92 module="env" function="time": imported function does not match the expected type
| deserialize | @ | 870.1260b274e8c70c25…0b274e8c70c25c3c4:2 |
| S | @ | 870.1260b274e8c70c25…0b274e8c70c25c3c4:2 |
| Promise.then (async) | | |
| apply | @ | 870.1260b274e8c70c25…0b274e8c70c25c3c4:2 |
| h | @ | 413.df2804f5ae3431aa…804f5ae3431aa4c17:1 |
| create | @ | 413.df2804f5ae3431aa…804f5ae3431aa4c17:1 |
| startNew | @ | kernels.js:123 |
| startNew | @ | sessions.js:105 |
| (anonymous) | @ | index.js:366 |
| route | @ | router.js:85 |
| await in route (async) | | |
| fetch | @ |
Description
Trying the latest version from the docs and creating a new notebook:
The following error shows up in the dev tools console:
xpython.js:8 xkernel::init
xpython.js:8 Before instantiating debugger
xpython.js:8 Debugger instantiated
Reproduce
https://jupyterlite-xeus.readthedocs.io/en/latest/lite/lab/index.html
Expected behavior
No "error" in the dev tools console.
Context
Latest version from main
: c2b9362
Recommend Projects
-
-
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. 📊📈🎉
-
Recommend Topics
-
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.
-
Recommend Org
-
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.
-