Coder Social home page Coder Social logo

xeus-python-demo's Introduction

JupyterLite

ci-badge lite-badge binder-badge docs-badge

JupyterLite is a JupyterLab distribution that runs entirely in the browser built from the ground-up using JupyterLab components and extensions.

⚡ Status ⚡

Although JupyterLite is currently being developed by core Jupyter developers, the project is still unofficial.

Not all the usual features available in JupyterLab and the Classic Notebook will work with JupyterLite, but many already do!

Don't hesitate to check out the documentation for more information and project updates.

✨ Try it in your browser ✨

JupyterLite works with both JupyterLab and Jupyter Notebook.

Try it with JupyterLab! Try it with Jupyter Notebook!
lab-screenshot notebook-screenshot

🏗️ Build your own JupyterLite 🏗️

You can build your own JupyterLite website in a couple of minutes, with custom extensions and packages.

See the documentation for more details.

Browser-based Interactive Computing

JupyterLite is all about accessible browser-based interactive computing:

  • Python kernel backed by Pyodide running in a Web Worker
    • Initial support for interactive visualization libraries such as altair, bqplot, ipywidgets, matplotlib, and plotly
  • JavaScript kernel running in a Web Worker
  • View hosted example Notebooks and other files, then edit, save, and download from the browser's IndexDB (or localStorage)
  • Support for saving settings for JupyterLab/Lite core and federated extensions
  • Basic session and kernel management to have multiple kernels running at the same time
  • Support for Code Consoles

Ease of Deployment

  • Served via well-cacheable, static HTTP(S), locally or on most static web hosts
  • Embeddable within larger applications
  • Requires no dedicated application server much less a container orchestrator
  • Fine-grained configurability of page settings, including reuse of federated extensions

Showcase

Jupyter Interactive Widgets

widgets

JupyterLab Mimerender Extensions

image

Matplotlib Figures

image

Altair

altair

Plotly

plotly

Development install

See the contributing guide for a development installation.

Related

JupyterLite is a reboot of several attempts at making a full static Jupyter distribution that runs in the browser, without having to start the Python Jupyter Server on the host machine.

The goal is to provide a lightweight computing environment accessible in a matter of seconds with a single click, in a web browser and without having to install anything.

This project is a collection of packages that can be remixed together in variety of ways to create new applications and distributions. Most of the packages in this repo focus on providing server-like components that run in the browser (to manage kernels, files and settings), so existing JupyterLab extensions and plugins can be reused out of the box.

See also:

  • p5-notebook: A minimal Jupyter Notebook UI for p5.js kernels running in the browser
  • jyve: Jupyter Kernels, right inside JupyterLab
  • Starboard Notebook: In-browser literal notebooks
  • Basthon: A Jupyter notebook implementation using Pyodide

👥 Contributors

Join our community and become a contributor today! 🚀

xeus-python-demo's People

Contributors

agoose77 avatar ianthomas23 avatar jtpio avatar martinrenou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xeus-python-demo's Issues

Install of extra packages not working: environment.yml not used?

Description

It doesn't appear that adding libraries to the environment.yml file pre-installs extra packages to the environment as intended.

Reproduce

  1. Add a library (e.g. pandas) to the environment.yml file
  2. Wait for github actions to complete
  3. Attempt to import library (e.g. import pandas as pd)
  4. See error, ModuleNotFoundError: No module named 'pandas'

Expected behavior

This should load the library as intended and outlined in README.md and @jtpio's Jupytercon video.

Context

  • JupyterLite version: 0.1.0
  • Using GitHub actions to build and deploy. Repo and GitHub Page
  • Looking at the action logs, it never looks like the environment.yml file is used, only the build-environment.yml is used to create an environment.

no-arc packages

Problem

For non experts the concept: "no-arc" packages might be confusing.

Suggested Improvement

Please add an extra line as to explain what is this in the readme or a link to the installable packages

Failing to import scikit-learn after installing

Scikitlearn fails to import

Raises error no module found named unittest.

File /lib/python3.10/site-packages/numpy/testing/init.py:8
1 """Common test support for all numpy test scripts.
2
3 This single module should provide all the common functionality for numpy tests
(...)
6
7 """
----> 8 from unittest import TestCase
10 from . import _private
11 from ._private.utils import *

ModuleNotFoundError: No module named 'unittest'

Reproduce

name: xeus-python-kernel
channels:

jupyter lite build
jupyter lite serve

  • In the notebook in the kernel xeus
    import sklearn

Expected behavior

correctly import scikitlearn

Cannot build xeus-python-demo

Description

I am trying to build the xeus-python-demo locally but I am getting this strange error (extracted from much larger traceback, included below).

conda.auxlib.exceptions.ValidationError: 'emscripten' is not a valid Platform

I tried building it last night with the same result. And, after I hit this error, whenever I ran other commands in conda, e.g. conda create -n myenvname python=3.12, the commands would not run and I would get the same error! (Weird, yeah?)

Because it seemed like my miniconda3 installation was now broken, I completely removed conda (and all of my many environments), and re-installed conda anew from miniforge3 (which I had been meaning to do that anyway).

I just tried cloning the repo again fresh and installing it locally into a fresh conda environment. As before, the kernel did not install after running jupyter lite build. So I executed conda install xeus-python to install the xeus kernel into my conda environment. When I then ran jupyter lite build again, a completely different series of screens flashed by and then I got the same error as shown above (full stack trace below).

Get this! Now, again, my conda installation seems to be broken because I can no longer run conda create -n myenvname python=3.12 without it ending in the same error.

The conda-breaking part of this is probably an upstream issue as well but I could really use some guidance on what is happening here. How can I fix this? Are there any build steps I am missing?

Reproduce

  1. Install latest miniforge3 on ubuntu
  2. conda create -n jupyterlite python=3.12
  3. conda activate jupyterlite
  4. git clone https://github.com/jupyterlite/xeus-python-demo.git
  5. cd xeus-python-demo
  6. conda install jupyterlite-core
  7. jupyter lite build -> Successfully builds Jupyterlite but without kernels
  8. conda install xeus-python
  9. jupyter lite build

CRASH

(See traceback below)

Expected behavior

Jupyterlite builds with xeus-python kernel and I am enjoying an excellent piece of new technology running in my browser! (Wow)

Context

  • JupyterLite version: 0.3.0
  • Operating System and version: Pop!_OS 22.04 LTS (Ubuntu 22.04 LTS)
  • Browser and version: 6.4.3160.42 (Stable channel) stable (64-bit)
Traceback
(jupyterlite)  connorferster@pop-os  ~/code/jupyterlite-xeus-python   main ±  jupyter lite build
static:jupyter-lite.json
.  pre_status:static:jupyter-lite.json
    tarball:         jupyterlite-app-0.3.0.tgz 13MB
    output:          /home/connorferster/code/jupyterlite-xeus-python/_output
    lite dir:        /home/connorferster/code/jupyterlite-xeus-python
    apps:            
    sourcemaps:      True
    unused packages: True
archive:archive
contents:contents
icons:icons
lite:jupyter-lite.json
mimetypes:jupyter-lite.json
serve:contents
settings:overrides
translation:translation
.  status:archive:archive
[LiteBuildApp] No archive (yet): jupyterlite-xeus-python-jupyterlite.tgz
.  status:contents:contents
    contents: 0 files
.  status:icons:icons
    favicon files: 0 files
.  status:lite:jupyter-lite.json
[LiteBuildApp]     jupyter-lite.(json|ipynb): 0 files
.  status:mimetypes:jupyter-lite.json
    filetypes:         26 
.  status:serve:contents
    url: http://127.0.0.1:8000/
    server: tornado
    headers:
.  status:settings:overrides
    overrides.json: 0
.  status:translation:translation
    translation files: 2 files
static:output_dir
-- pre_init:static:output_dir
static:unpack
-- init:static:unpack
federated_extensions:copy:ext:jupyterlab_pygments
federated_extensions:copy:ext:@jupyterlite/xeus
.  pre_build:federated_extensions:copy:ext:jupyterlab_pygments
.  pre_build:federated_extensions:copy:ext:@jupyterlite/xeus
icons:copy
/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_core/addons/translation.py:88: UserWarning: [lite] [translation] install `jupyterlab_server` to load translations: No module named 'jupyterlab_server'
  if not self.is_sys_prefix_ignored() and has_optional_dependency(
translation:copy
.  build:icons:copy
-- build:translation:copy
federated_extensions:patch
federated_extensions:settings

Looking for: []

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

 $ mamba activate /tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel

To deactivate an active environment, use

 $ mamba deactivate

Looking for: ['xeus-python', 'forallpeople', 'ipycanvas']

https://repo.mamba.pm/emscripten-forge/emscripte.. 0.9s
https://repo.mamba.pm/emscripten-forge/noarch (c.. Checked 0.3s
warning libmamba Could not parse mod/etag header
[+] 0.3s
conda-forge/emscripten-wasm32 ━━━━━━━╸━━━━━━━━━━ 0.0 B @ ??.?MB/s 0.3s
conda-forge/emscripten-wasm32 @ ??.?MB/s 404 failed 0.3s
https://repo.mamba.pm/emscripten-forge/emscripte.. @ 74.3kB/s 0.6s
https://repo.mamba.pm/emscripten-forge/noarch 1.9kB @ 2.3kB/s 0.8s
conda-forge/noarch 15.2MB @ 18.3MB/s 0.9s
Transaction

Prefix: /tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel

Updating specs:

  • xeus-python
  • forallpeople
  • ipycanvas

Package Version Build Channel Size
──────────────────────────────────────────────────────────────────────────────────────────────────
Install:
──────────────────────────────────────────────────────────────────────────────────────────────────

  • pillow 10.3.0 hf51ec75_0 repo.mamba.pm/emscripten-forge 1MB
  • pyjs 2.1.0 py311hd5f3483_7 repo.mamba.pm/emscripten-forge 4MB
  • emscripten-abi 3.1.45 h267e887_29 repo.mamba.pm/emscripten-forge 11kB
  • python 3.11.3 h_hash_24_cpython repo.mamba.pm/emscripten-forge 13MB
  • wheel 0.43.0 pyhd8ed1ab_1 conda-forge Cached
  • setuptools 70.1.1 pyhd8ed1ab_0 conda-forge Cached
  • pip 24.0 pyhd8ed1ab_0 conda-forge Cached
  • six 1.16.0 pyh6c4a22f_0 conda-forge Cached
  • parso 0.8.4 pyhd8ed1ab_0 conda-forge Cached
  • ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge Cached
  • wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge Cached
  • pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge Cached
  • executing 2.0.1 pyhd8ed1ab_0 conda-forge Cached
  • typing_extensions 4.12.2 pyha770c72_0 conda-forge Cached
  • traitlets 5.14.3 pyhd8ed1ab_0 conda-forge Cached
  • pygments 2.18.0 pyhd8ed1ab_0 conda-forge Cached
  • decorator 5.1.1 pyhd8ed1ab_0 conda-forge Cached
  • backcall 0.2.0 pyh9f0ad1d_0 conda-forge 14kB
  • xeus-python-shell-raw 0.6.3 pyhd8ed1ab_0 conda-forge 12kB
  • pickleshare 0.7.5 py_1003 conda-forge Cached
  • widgetsnbextension 4.0.11 pyhd8ed1ab_0 conda-forge 1MB
  • jupyterlab_widgets 3.0.11 pyhd8ed1ab_0 conda-forge 186kB
  • forallpeople 2.6.7 pyhd8ed1ab_0 conda-forge 36kB
  • asttokens 2.4.1 pyhd8ed1ab_0 conda-forge Cached
  • jedi 0.19.1 pyhd8ed1ab_0 conda-forge Cached
  • pexpect 4.9.0 pyhd8ed1ab_0 conda-forge Cached
  • prompt-toolkit 3.0.47 pyha770c72_0 conda-forge Cached
  • comm 0.2.2 pyhd8ed1ab_0 conda-forge Cached
  • matplotlib-inline 0.1.7 pyhd8ed1ab_0 conda-forge Cached
  • stack_data 0.6.2 pyhd8ed1ab_0 conda-forge Cached
  • numpy 2.0.0 py311hc8e14bb_0 repo.mamba.pm/emscripten-forge 7MB
  • ipython 8.25.0 py311hf215df6_1 repo.mamba.pm/emscripten-forge 2MB
  • xeus-python-shell 0.6.3 pyhd8ed1ab_0 conda-forge 7kB
  • ipywidgets 8.1.3 pyhd8ed1ab_0 conda-forge 114kB
  • ipycanvas 0.13.2 pyhd8ed1ab_0 conda-forge 57kB
  • xeus-python 0.17.0 py311h8776317_6 repo.mamba.pm/emscripten-forge 4MB

Summary:

Install: 36 packages

Total download: 33MB

──────────────────────────────────────────────────────────────────────────────────────────────────

backcall 13.7kB @ 169.7kB/s 0.1s
widgetsnbextension 1.1MB @ 5.1MB/s 0.1s
emscripten-abi 10.9kB @ 7.2kB/s 1.5s
forallpeople 35.9kB @ 21.5kB/s 0.2s
pyjs 4.0MB @ 1.3MB/s 3.1s
jupyterlab_widgets 186.5kB @ 56.9kB/s 0.1s
ipycanvas 57.1kB @ 17.1kB/s 0.1s
xeus-python-shell 6.7kB @ 2.0kB/s 0.1s
numpy 7.5MB @ 1.9MB/s 3.7s
xeus-python-shell-raw 11.7kB @ 3.0kB/s 0.1s
ipywidgets 113.8kB @ 28.4kB/s 0.1s
pillow 1.1MB @ 242.3kB/s 4.7s
python 13.2MB @ 2.5MB/s 5.3s
ipython 1.6MB @ 292.3kB/s 2.1s
xeus-python 3.8MB @ 319.8kB/s 10.3s
'emscripten' is not a valid Platform

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 959, in exception_converter
    raise e
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 952, in exception_converter
    exit_code = _wrapped_main(*args, **kwargs)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 898, in _wrapped_main
    result = do_call(parsed_args, p)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 763, in do_call
    exit_code = install(args, parser, "install")
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/mamba/mamba.py", line 569, in install
    handle_txn(conda_transaction, prefix, args, newenv)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/mamba/linking.py", line 38, in handle_txn
    unlink_link_transaction.download_and_extract()
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/link.py", line 255, in download_and_extract
    self._pfe.execute()
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 771, in execute
    self.prepare()
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/common/io.py", line 85, in decorated
    return f(*args, **kwds)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 750, in prepare
    self.paired_actions.update(
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 751, in <genexpr>
    (prec, self.make_actions_for_record(prec)) for prec in largest_first
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 595, in make_actions_for_record
    extracted_pcrec = next(
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 596, in <genexpr>
    (
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 599, in <genexpr>
    PackageCacheData(pkgs_dir).query(pref_or_spec)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 166, in query
    for pcrec in self._package_cache_records.values()
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 306, in _package_cache_records
    self.load()
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 127, in load
    package_cache_record = self._make_single_record(base_name)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 369, in _make_single_record
    package_cache_record = PackageCacheRecord.from_objects(
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 790, in from_objects
    return cls(**init_vars)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 743, in __call__
    instance = super().__call__(*args, **kwargs)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/models/records.py", line 418, in __init__
    super().__init__(*args, **kwargs)
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 759, in __init__
    setattr(self, key, kwargs[key])
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 428, in __set__
    self.box(instance, instance.__class__, val),
  File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 570, in box
    raise ValidationError(val, msg=e1)
conda.auxlib.exceptions.ValidationError: 'emscripten' is not a valid Platform

$ /home/connorferster/miniforge3/condabin/mamba install --yes --prefix /tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel -c https://repo.mamba.pm/emscripten-forge -c conda-forge xeus-python forallpeople ipycanvas

environment variables:
CIO_TEST=
CONDARC=/tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel/.condarc
CONDA_DEFAULT_ENV=jupyterlite
CONDA_EXE=/home/connorferster/miniforge3/bin/conda
CONDA_PREFIX=/home/connorferster/miniforge3/envs/jupyterlite
CONDA_PREFIX_1=/home/connorferster/miniforge3
CONDA_PROMPT_MODIFIER=(jupyterlite)
CONDA_PYTHON_EXE=/home/connorferster/miniforge3/bin/python
CONDA_ROOT=/home/connorferster/miniforge3
CONDA_SHLVL=2
CURL_CA_BUNDLE=
DEFAULTS_PATH=/usr/share/gconf/pop.default.path
LD_PRELOAD=
MANDATORY_PATH=/usr/share/gconf/pop.mandatory.path
PATH=/home/connorferster/miniforge3/envs/jupyterlite/bin:/home/connorferste
r/miniforge3/condabin:/home/connorferster/.nvm/versions/node/v22.2.0/b
in:/home/connorferster/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/
sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lo
cal/go/bin:/home/connorferster/.repobee/bin:/opt/ParaView-
5.11/bin:/usr/local/go/bin
REQUESTS_CA_BUNDLE=
SSL_CERT_FILE=
WINDOWPATH=2

 active environment : jupyterlite
active env location : /home/connorferster/miniforge3/envs/jupyterlite
        shell level : 2
   user config file : /home/connorferster/.condarc

populated config files : /home/connorferster/miniforge3/.condarc
/tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel/.condarc
conda version : 24.3.0
conda-build version : not installed
python version : 3.10.14.final.0
solver : libmamba (default)
virtual packages : __conda=24.3.0=0
base environment : /home/connorferster/miniforge3 (writable)
conda av data dir : /home/connorferster/miniforge3/etc/conda
conda av metadata url : None
channel URLs : https://repo.mamba.pm/emscripten-forge/emscripten-wasm32
https://repo.mamba.pm/emscripten-forge/noarch
https://conda.anaconda.org/conda-forge/emscripten-wasm32
https://conda.anaconda.org/conda-forge/noarch
package cache : /home/connorferster/miniforge3/pkgs
/home/connorferster/.conda/pkgs
envs directories : /home/connorferster/miniforge3/envs
/home/connorferster/.conda/envs
platform : emscripten-wasm32
user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.14 Linux/6.4.6-76060406-generic pop/22.04 glibc/2.35 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
UID:GID : 1000:1000
netrc file : /home/connorferster/.netrc
offline mode : False

An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install

[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus] [ERR] Command '['/home/connorferster/miniforge3/condabin/mamba', 'install', '--yes', '--prefix', PosixPath('/tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel'), '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'conda-forge', 'xeus-python', 'forallpeople', 'ipycanvas']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/doit_cmd.py", line 294, in run
return command.parse_execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/cmd_base.py", line 150, in parse_execute
return self.execute(params, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/cmd_base.py", line 570, in execute
return self._execute(**exec_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/cmd_run.py", line 265, in _execute
return runner.run_all(self.control.task_dispatcher())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/runner.py", line 254, in run_all
self.run_tasks(task_dispatcher)
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/runner.py", line 213, in run_tasks
node = task_dispatcher.generator.send(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/control.py", line 629, in _dispatcher_generator
next_step = node.step()
^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/control.py", line 336, in step
return next(self.generator)
^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/control.py", line 345, in _func
for value in decorated(*args, **kwargs):
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/control.py", line 473, in _add_task
new_tasks = generate_tasks(to_load, task_gen, ref.doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/loader.py", line 390, in generate_tasks
for task_dict, x_doc in flat_generator(gen_result, gen_doc):
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/doit/loader.py", line 27, in flat_generator
for item in gen:
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_core/manager.py", line 138, in _delayed_gather
yield from _gather()
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_core/manager.py", line 131, in _gather
raise error
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_core/manager.py", line 123, in _gather
for task in getattr(addon, attr)(self):
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_xeus/add_on.py", line 124, in post_build
self.create_prefix()
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_xeus/add_on.py", line 148, in create_prefix
create_conda_env_from_env_file(root_prefix, yaml_content, env_file.parent)
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 53, in create_conda_env_from_env_file
create_conda_env_from_specs(
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 69, in create_conda_env_from_specs
_create_conda_env_from_specs_impl(
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 126, in _create_conda_env_from_specs_impl
return _create_env_with_config(MAMBA_COMMAND, prefix_path, specs, channels_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/site-packages/jupyterlite_xeus/create_conda_env.py", line 144, in _create_env_with_config
subprocess_run(
File "/home/connorferster/miniforge3/envs/jupyterlite/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/connorferster/miniforge3/condabin/mamba', 'install', '--yes', '--prefix', PosixPath('/tmp/tmpwsk5p5rz/env/envs/xeus-python-kernel'), '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'conda-forge', 'xeus-python', 'forallpeople', 'ipycanvas']' returned non-zero exit status 1.

Build environment vs Environment.yml and finding out which packages are causing issues

Could you please explain why packages need to be in the build environment and which in the environment.yml ?
My understanding right now is that
build-environment.yml = extensions you want enabled in the jupyter lite build stage
Environment.yml = packages you want to be preloaded on your jupyterlite page

on my custom demo page Link here

name: build-env
channels:
  - conda-forge
dependencies:
  - python
  - pip
  - jupyter_server
  - jupyterlab-night
  - ipywidgets>=8.1
  - plotly>=5,<6
  - jupyterlab-cell-flash
  - jupyterlab-fasta>=3,<4
  - jupyterlab-geojson>=3,<4
  - jupyterlite-xeus>=0.1.2,<0.2
  - jupyterlite-core>=0.2,<0.3
  - pip:
    - libarchive-c 

When I was running the ci-cd pipeline it threw up also a warning for libarchive-c ; from an optimization perspective is it recommended to do this via pip like above ?

name: xeus-python-kernel
channels:
  - https://repo.mamba.pm/emscripten-forge
  - https://repo.mamba.pm/conda-forge
dependencies:
  - xeus-python
  - altair
  - bqplot
  - geopy
  - ipycanvas
  - ipydatagrid
  - ipympl
  - matplotlib
  - missingno
  - numpy
  - openpyxl
  - pandas
  - folium
  - plotly
  - pycountry
  - scikit-learn
  - scipy
  - seaborn
  - sqlalchemy
  - vega_datasets

Is it recommended to use repo.mamba for the second channel or just simple conda-forge ?

channels:
  - https://repo.mamba.pm/emscripten-forge
  - https://repo.mamba.pm/conda-forge

vs

channels:
  - https://repo.mamba.pm/emscripten-forge
  - conda-forge

Pin Pydantic to <2.0 in build-environment.yml

Description

xeus-python-demo uses the latest pydantic, which is now v2.0. This appears to create an error in the build of the demo.

/home/runner/micromamba-root/envs/build-env/lib/python3.11/site-packages/jupyterlite_core/addons/__init__.py:69: UserWarning: [lite] [jupyterlite-xeus-python] failed to load: To define root models, use `pydantic.RootModel` rather than a field called '__root__'

While template will build and deploy (despite this error), the environment.yml's package (ipycanvas) is not available in the jupyterlite-xeus-python kernel (after launching the jupyterlite)

Pinning pydantic to <2.0 in the build-environment.yml will allow the demo to build and deploy properly.

Reproduce

Use to template to create a new demo.
Add page to github actions

Context

  • Browser and version: Chrome Version 114.0.5735.84

Template `xeus-python-demo` does not build.

Description

Building a clone of the jupyterlite/xeus-python-demo fails.

Symptom:

https://github.com/fangohr/issue-xeus-python-demo-notbuilding/actions/runs/6887563503/job/18734958333

Reproduce

  1. Go to https://github.com/jupyterlite/xeus-python-demo
  2. Click on Use this template
  3. Decide on a location for the new repository. I have chosen https://github.com/fangohr/issue-xeus-python-demo-notbuilding
  4. Github workflows try to execute and fail.

See output at https://github.com/fangohr/issue-xeus-python-demo-notbuilding/actions/runs/6887563503/job/18734958333#step:5:299

Expected behavior

Template when forked should build.

Should it be possible to `import ssl`?

A package that I'd like to use imports 'ssl'. Could you please advise if there is any way to make this available to a zeus-python kernel in jupyterlite? When I run import ssl in the demo notebook (https://jupyterlite.github.io/xeus-python-demo/retro/notebooks/?path=demo.ipynb), the traceback includes:

File /lib/python3.10/ssl.py:98
95 from collections import namedtuple
96 from enum import Enum as _Enum, IntEnum as _IntEnum, IntFlag as _IntFlag
---> 98 import _ssl # if we can't import it, let the error propagate
100 from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
101 from _ssl import _SSLContext, MemoryBIO, SSLSession
ModuleNotFoundError: No module named '_ssl'

I've tried adding openssl to dependencies in the environment.yml file, but get the same result (and it breaks the rule of having a 'noarch' version').

problem with tzdata or zoneinfo

hi,

trying to get plotnine working, I fail on a 'No time zone found with key UTC'

I can't find how to resolve this , even if trying to include tzdata

environment

name: xeus-python-kernel
channels:
  - https://repo.mamba.pm/emscripten-forge
  - https://repo.mamba.pm/conda-forge
dependencies:
  - ipycanvas
  - numpy
  - matplotlib
  - seaborn
  - plotnine
  - pandas
  - statsmodels
  - scikit-learn
  - scipy
  - sqlite
  - bokeh
  - panel
  - altair
  - ipympl
  - ipyleaflet
  - ipydatagrid
  - ipycanvas
  - vega_datasets
  - plotly
  - bqplot
  - black
  - pyviz_comms
  - openpyxl
  - tzdata
  - httpx

typical code that doesn't want to work:

from zoneinfo import ZoneInfo
utc = ZoneInfo('UTC')

target code

from plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap
from plotnine.data import mtcars

(ggplot(mtcars, aes('wt', 'mpg', color='factor(gear)'))
 + geom_point()
 + stat_smooth(method='lm')
 + facet_wrap('~gear'))

No custom packages can be added during build

(not sure if this should be moved to xeus-python or jupyterlite)

Description

I cannot add custom packages as described by "📦 How to install extra packages". numpy seems to load correctly in all attempts, but all other packages are missing:

  __  _____ _   _ ___
  \ \/ / _ \ | | / __|
   >  <  __/ |_| \__ \
  /_/\_\___|\__,_|___/
​
  xeus-python: a Jupyter kernel for Python
  Python 3.10.2

import numpy

import pandas

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 1
----> 1 import pandas

ModuleNotFoundError: No module named 'pandas'

Reproduce

  1. Add a few packages from emscripten-forge to the environment.yml file:
name: xeus-python-kernel
channels:
  - https://repo.mamba.pm/emscripten-forge
  - https://repo.mamba.pm/conda-forge
dependencies:
  - ipycanvas
  - lxml
  - peewee
  - numpy
  - pandas
  1. Push to trigger GH Action workflow.

You can see that the workflow completes successfully in the test repo I created.

Expected behavior

Custom packages are available to the kernel.

Context

  • JupyterLite version: 0.1.1
  • Operating System and version: macOS 13.5.1 (22G90)
  • Browser and version: Version 115.0.5790.170 (Official Build) (arm64)

It seems that not a single one of my requested packages were added during the build process:

help("modules")

Please wait a moment while I gather a list of all available modules...

/lib/python3.10/pkgutil.py:92: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
  __import__(info.name)
IPython             ast                 imghdr              sched
__future__          asttokens           imp                 secrets
_abc                asynchat            importlib           select
_aix_support        asyncio             inspect             selectors
_ast                asyncore            io                  shelve
_bisect             atexit              ipaddress           shlex
_blake2             audioop             itertools           shutil
_bootsubprocess     backcall            jedi                signal
_bz2                backports           json                site
_codecs             base64              keyword             six
_codecs_cn          bdb                 linecache           smtpd
_codecs_hk          binascii            locale              smtplib
_codecs_iso2022     binhex              logging             sndhdr
_codecs_jp          bisect              lzma                socket
_codecs_kr          builtins            mailbox             socketserver
_codecs_tw          bz2                 mailcap             sqlite3
_collections        cProfile            marshal             sre_compile
_collections_abc    calendar            math                sre_constants
_compat_pickle      cgi                 matplotlib_inline   sre_parse
_compression        cgitb               mimetypes           ssl
_contextvars        chunk               mmap                stack_data
_crypt              cmath               modulefinder        stat
_csv                cmd                 multiprocessing     statistics
_ctypes             code                netrc               string
_ctypes_test        codecs              nntplib             stringprep
_datetime           codeop              ntpath              struct
_decimal            collections         nturl2path          subprocess
_functools          colorsys            numbers             sunau
_heapq              compileall          numpy               symtable
_imp                concurrent          opcode              sys
_io                 configparser        operator            sysconfig
_json               contextlib          optparse            tabnanny
_locale             contextvars         os                  tarfile
_lsprof             copy                parso               telnetlib
_markupbase         copyreg             pathlib             tempfile
_md5                crypt               pdb                 textwrap
_multibytecodec     csv                 pexpect             this
_operator           ctypes              pickle              threading
_pickle             dataclasses         pickleshare         time
_posixsubprocess    datetime            pickletools         timeit
_py_abc             decimal             pip                 token
_pydecimal          decorator           pipes               tokenize
_pyio               difflib             pkg_resources       trace
_queue              dis                 pkgutil             traceback
_random             distutils           platform            tracemalloc
_sha1               doctest             plistlib            traitlets
_sha256             email               poplib              tty
_sha3               encodings           posix               types
_sha512             enum                posixpath           typing
_signal             errno               pprint              unicodedata
_sitebuiltins       executing           profile             urllib
_socket             faulthandler        prompt_toolkit      uu
_sqlite3            filecmp             pstats              uuid
_sre                fileinput           pty                 warnings
_stat               fnmatch             ptyprocess          wave
_string             fractions           pure_eval           wcwidth
_strptime           ftplib              py_compile          weakref
_struct             functools           pyclbr              wheel
_symtable           gc                  pydoc               wsgiref
_sysconfigdata__emscripten_wasm32-emscripten genericpath         pydoc_data          xdrlib
_thread             getopt              pyexpat             xeus_python_shell
_threading_local    getpass             pygments            xml
_tracemalloc        gettext             pyjs                xmlrpc
_warnings           glob                pyparsing           xxsubtype
_weakref            graphlib            queue               zipapp
_weakrefset         gzip                quopri              zipfile
_xxsubinterpreters  hashlib             random              zipimport
abc                 heapq               re                  zlib
aifc                hmac                reprlib             zoneinfo
antigravity         html                requests            
argparse            http                rlcompleter         
array               imaplib             runpy               

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
Browser Output
Paste the output from your browser Javascript console here.

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.