GithubHelp home page GithubHelp logo

jupyterlite / xeus-python-kernel Goto Github PK

View Code? Open in Web Editor NEW
30.0 5.0 19.0 819 KB

xeus-python in JupyterLite

Home Page: https://xeus-python-kernel.readthedocs.io

License: BSD 3-Clause "New" or "Revised" License

JavaScript 9.63% Python 69.86% TypeScript 18.61% CSS 1.91%
python jupyterlite jupyterlite-kernel wasm xeus-python

xeus-python-kernel's Introduction

xeus-python-kernel's People

Contributors

andeplane avatar benbovy avatar derthorsten avatar github-actions[bot] avatar johanmabille avatar jtpio avatar jzavala-gonzalez avatar lesteve avatar martinrenou avatar vasiljevic 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

Watchers

 avatar  avatar  avatar  avatar  avatar

xeus-python-kernel's Issues

Development build instructions are broken

There are some issues with the development build instructions. Some are mistakes, and others are places where the instructions might be more helpful.

Here are the current development build instructions, with issues interspersed.

# Clone the repo to your local environment
# Change directory to the jupyterlite_xeus_python directory

Changing into this directory makes the next command not work.

# Install package in development mode
python -m pip install -e .

# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite

This requires jupyter to be installed. What is the best way to do that? Should conda be used, and if so how?

# Rebuild extension Typescript source after making changes
jlpm run build

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

What if we we want to run jupyterlite rather than Jupyter?

Some file access fails sometimes

Description

Sometimes fails with

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'path')
    at e.onmessage (index.js:160:34)
kernels.js:50 Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at abort (/euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.js:9:20546)
    at _abort (/euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.js:9:200143)
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm
    at /euroscipy-2022-jupyterlite-emscripten-forge/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.wasm

Reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error '...'

Expected behavior

Context

  • JupyterLite version:
  • Operating System and version:
  • Browser and version:
Browser Output
Paste the output from your browser Javascript console here.

Registered kernel spec name does not match the name served by jupyer-server

Description

The spec registered by the extension uses xeus-python as the kernel name, but in JupyterLab, the kernel name served by /api/kernelspecs is xpython. The mismatch makes Voici can not find the correct kernel for a notebook saved by JupyterLab

spec: {
name: 'xeus-python',
display_name: 'Python (XPython)',
language: 'python',
argv: [],
resources: {
'logo-32x32': logo32,
'logo-64x64': logo64

`import pandas` hangs with jupyterlite-xeus-python 0.5.4 and jupyterlite 0.1.0b12

Description

Execusion of cell import pandas hangs. This exception message is shown on the JavaScript Console:

Uncaught (in promise) SyntaxError: Unexpected end of input (at services.js:32:51)
at services.js:32:51
at new Promise ()
at services.js:28:7

Reproduce

  1. have installed jupyterlite 0.1.0b12 and jupyterlite-xeus-python 0.5.4
  2. init new site and build it width jupyter lite build --XeusPythonEnv.packages=openpyxl,pandas,matplotlib
  3. Open site in the browser
  4. Create new notebook and select Xeus-python kernel
  5. Add cell with import pandas and run it
  6. Go to JavaScript console and see an exeption like this: Uncaught (in promise) SyntaxError: Unexpected end of input (at services.js:32:51) ...

Expected behavior

Pandas should be normally imported in several seconds

Context

  • JupyterLite version: 0.1.0b12
  • Xeus Pzthon Kernel version: 0.5.4
  • Operating System and version: Ubuntu 22.04 (WSL)
  • Browser and version: Chrome version 104.0.5112.81 (Official Build) (64-bit) on Windows 10
Browser Output
Uncaught (in promise) SyntaxError: Unexpected end of input (at services.js:32:51)
    at services.js:32:51
    at new Promise ()
    at services.js:28:7

Make `0.x` versions of `jupyterlite-xeus-python` compatible with JupyterLite 0.2.0

The update to JupyterLite 0.2.0 was done in #155.

There isn't many breaking changes in JupyterLite 0.2.0 that affect jupyterlite-xeus-python.

Except for the removal of ENV_EXTENSIONS from the top-level jupyterlite_core.addons.federated_extensions:

from jupyterlite_core.addons.federated_extensions import (
FederatedExtensionAddon,
ENV_EXTENSIONS,
)

Maybe it could be useful to enable jupyterlite-xeus-python==0.x to work with JupyterLite 0.2.0, in case #164 or emscripten-forge/recipes#643 would prevent some users from upgrading.

Error when building from source with source maps.

When building from source, the last stage of jlpm run build yields

Failed to parse source map from '/home/sylvain/dev/jupyterlite/xeus-python-kernel/node_modules/@jupyterlite/server/src/app.ts' file: Error: ENOENT: no such file or directory, open '/home/sylvain/dev/jupyterlite/xeus-python-kernel/node_modules/@jupyterlite/server/src/app.ts'

It seems that the source map files are in server/lib instead of server/src.

scipy.misc is missing data files

Description

scipy.misc.face() fails since it can not find the associated data file. There are other similar functions that are missing data files in scipy.misc: scipy.misc.electrocardiogram() and scipy.misc.ascent()

The package from emscripten-forge does contain the .dat files. but somehow they are not visible by the kernel.

Reproduce

jupyter lite build --XeusPythonEnv.packages=scipy
jupyter lite serve

Open JupyterLite and start a new notebook with a xeus-python kernel.

from scipy.misc import face

arr = face()

This gives an error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/tmp/xpython_42/1607471528.py in <cell line: 3>()
      1 from scipy.misc import face
      2 
----> 3 arr = face()

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/scipy/misc/_common.py in face(gray)
    220     import bz2
    221     import os
--> 222     with open(os.path.join(os.path.dirname(__file__), 'face.dat'), 'rb') as f:
    223         rawdata = f.read()
    224     data = bz2.decompress(rawdata)

FileNotFoundError: [Errno 44] No such file or directory: '/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/scipy/misc/face.dat'

From the screenshot below, you can see that there are no .dat file in the scipy.misc folder:
image

This does work fine in a Pyodide kernel.
image

Expected behavior

No error

Issue when using the `itables` package

Description

The itables package allows for making pandas dataframes more interactive: https://github.com/mwouts/itables

It seems to be working fine with the Pyodide kernel:

image

However xeus python has issues importing the package with import itables:

FileNotFoundError: [Errno 44] No such file or directory: '/tmp/xeus-python-kernel/envs/jupyterlite-tutorial-demo/lib/python3.10/site-packages/itables/html/itables.css'

image

While checking the directory content looks fine with:

import os
os.listdir()

Reproduce

Create a new environment with itables as a dependency.

Expected behavior

itables should work in the xeus python kernel.

At first it looked like it could have been an issue with the service worker not able to find the files.

But digging into this more it seems that the html folder is missing:

image

Context

This might be similar to #120

ModuleNotFoundError: No module named 'webbrowser'

Description

Adding plotly to XeusPythonEnv.packages and importing it in a notebook results in the following:

ModuleNotFoundError: No module named 'webbrowser'

Reproduce

For example this deployment: https://scipy-2022-jupyterlite-virtual-poster--7.org.readthedocs.build/en/7/lite/lab/index.html?path=plotly.ipynb

Although the link will probably be invalid soon.

Expected behavior

Running import webbrowser on the Pyodide console works fine: https://pyodide.org/en/latest/console.html

image

Context

plotly depends on the webbrowser module being available.

tab completion not working in jupyterlite when using xeus-python kernel

To reproduce:

Expected behaviour: completions are shown showing print for example

Observed behaviour: no completion is shown.

I originally observed the behaviour when using jupyterlite build --XeusPython.packages locally

I tried both in Firefox and Chromium, same behaviour.

Pyolite tab-completion seems to work fine e.g. on https://numpy.org/

Output from the browser console:

ERROR: received bad message: NotImplementedError: Python version 3.10 is currently not supported. xpython_wasm.js:9:53168
<empty string> xpython_wasm.js:9:53168
At: xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/parso/grammar.py(264): load_grammar xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/jedi/api/environment.py(37): get_grammar xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/jedi/cache.py(112): wrapper xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/jedi/inference/__init__.py(91): __init__ xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/jedi/api/__init__.py(119): __init__ xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/jedi/api/__init__.py(729): __init__ xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/IPython/core/completer.py(1397): _jedi_matches xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/IPython/core/completer.py(2054): _complete xpython_wasm.js:9:53168
  /tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/IPython/core/completer.py(1886): _completions xpython_wasm.js:9:53168
<empty string> xpython_wasm.js:9:53168
Message type: complete_request xpython_wasm.js:9:53168

Here is a screenshot in case that helps
image

Does not load in Firefox

First of all, really impressive work to get xeus-python to compile to WebAssembly!

Description

Looks like the kernel does not load in Firefox though. The error logged in the dev tools might be relevant:

TypeError: WebAssembly.Tag is not a constructor

image

Reproduce

Open https://xeus-python-kernel.readthedocs.io/en/latest/ with Firefox 99.

Expected behavior

Should run in Firefox.

Fix declaration file and turn noImplicitAny to true

The tsconfig currently expects noImplicitAny to be false, to avoid the following typescript error when building: "Type 'typeof globalThis' has no index signature in TS".

This should be fixed by completing the declaration.ts.d file as explained here.

Failed to load resource: the server responded with a status of 404

Description

In https://jtp.io/lit/lab/index.html, run "import pandas", the following error happened:

Failed to load resource: the server responded with a status of 404 ()
index.js:540 Error: Shared module @jupyterlab/debugger doesn't exist in shared scope default
at ensureExistence (consumes:19:1)
at consumes:101:1
at consumes:82:1
at webpack/sharing/consume/default/@jupyterlab/debugger (consumes:151:1)
at consumes:265:1
at Array.forEach ()
at webpack_require.f.consumes (consumes:248:1)
at ensure chunk:6:1
at Array.reduce ()
at webpack_require.e (ensure chunk:5:1)
(anonymous) @ index.js:540
/lit/api/translations/default.json:1

    Failed to load resource: the server responded with a status of 404 ()

index.es6.js:308 TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
at te.items (model.js:183:21)
at te.items (model.js:563:28)
at te.items (model.js:601:29)
at J._onModelRefreshed (listing.js:1686:40)
at d (index.es6.js:555:18)
at e.emit (index.es6.js:513:17)
at s.emit (index.es6.js:112:17)
at te.onRunningChanged (model.js:513:25)
at d (index.es6.js:555:18)
at e.emit (index.es6.js:513:17)
e.exceptionHandler @ index.es6.js:308
mock-socket.js:763 WebSocket connection to 'wss://jtp.io/lit/api/kernels/c5fe2f87-7770-406f-91eb-64515e61dcce/channels?session_id=e3f1f6d2-6b9a-4f2b-b36d-eb43a66e0ba8' failed
w @ mock-socket.js:763
mock-socket.js:763 WebSocket connection to 'wss://jtp.io/lit/api/kernels/c5fe2f87-7770-406f-91eb-64515e61dcce/channels?session_id=652681c8-bd2f-4c4c-8c73-f0eb9b5a5acd' failed
w @ mock-socket.js:763
index.es6.js:308 TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
at te.items (model.js:183:21)
at te.items (model.js:563:28)
at te.items (model.js:601:29)
at J._onModelRefreshed (listing.js:1686:40)
at d (index.es6.js:555:18)
at e.emit (index.es6.js:513:17)
at s.emit (index.es6.js:112:17)
at te.onRunningChanged (model.js:513:25)
at d (index.es6.js:555:18)
at e.emit (index.es6.js:513:17)
e.exceptionHandler @ index.es6.js:308
mock-socket.js:763 WebSocket connection to 'wss://jtp.io/lit/api/kernels/c5fe2f87-7770-406f-91eb-64515e61dcce/channels?session_id=f4ddb789-279c-4bc3-9cca-1c2c0305eea9' failed
w @ mock-socket.js:763
213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2 Uncaught (in promise) DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.js' failed to load.
at Object.initialize (https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:10713)
at https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:10009
at new Promise ()
at new (https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:9987)
at https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:9934
at Object. (https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:11472)
at 213 (https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:11476)
at r (https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:11604)
at https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:11926
at https://jtp.io/lit/extensions/@jupyterlite/xeus-python-kernel/static/213.efd3bb893df42f78e3eb.js?v=efd3bb893df42f78e3eb:2:11934
default.js:493 Uncaught (in promise) Error: Kernel is dead
at C._sendMessage (default.js:493:19)
at C._sendKernelShellControl (default.js:448:14)
at C.sendShellMessage (default.js:424:21)
at C.requestExecute (default.js:778:21)
at e.execute (widget.js:630:31)
at e.execute (widget.js:1182:43)
at actions.js:1889:54
at actions.js:1807:50
at Array.map ()
at e.runSelected (actions.js:1807:37)

Reproduce

  1. Go to https://jtp.io/lit/lab/index.html
  2. Add a code cell
  3. Run "import pandas".
  4. See error in the console

I understand that pandas is not pre-installed. I just happened to check. It seems it is only related to the latest version.

Expected behavior

Pandas is not pre-installed, so "no module pandas available" should be mentioned.

Context

  • JupyterLite version: 0.2.0rc0
  • Operating System and version: Windows 11 23565.1000
  • Browser and version: Edge

xeus-python kernel doesn't start with firefox

Description

Reproduce

  1. Open firefox
  2. Go to https://jupyterlite.github.io/xeus-python-demo/retro/notebooks/?path=demo.ipynb
  3. Execute first cell

The execution hangs at [*]: import this

Expected behavior

See the zen of Python

Context

  • JupyterLite version: Version 0.1.0-beta.18
  • Operating System and version: Ubuntu 22.04
  • Browser and version: Firefox 110.0 64 bit, build by canonical
Browser Output
Unsatisfied version 5.5.2 from _JUPYTERLAB.CORE_OUTPUT of shared singleton module @jupyterlab/coreutils (required ^5.6.1) remoteEntry.8e4043cf4e118658c12f.js:1:5837
Registering new JupyterLite ServiceWorker https://jupyterlite.github.io/xeus-python-demo/service-worker-b2fb40a.js service-manager.ts:50:16
Default kernel not found, using 'xeus-python' validate.ts:73:12
JupyterLite ServiceWorker was sucessfully registered service-manager.ts:52:16
Kernel filesystem and JupyterLite contents will be synced index.ts:235:16
SingleFile is hooking the IntersectionObserver API to detect and load deferred images. single-file-hooks-frames.js:1:531
Uncaught (in promise) TypeError: s is undefined
    d index.js:61
2 index.js:61:12
xeus-python contents will be synced with Jupyter Contents 20.6704bc71563170623fd0.js:1:2688
Starting WebSocket: wss://jupyterlite.github.io/xeus-python-demo/api/kernels/ed718396-d9c7-45c8-bd13-607e9106b8cd default.ts:1251:12
Default kernel not found, using 'xeus-python' validate.ts:73:12
Settings failed to load for (@jupyterlab/csvviewer-extension:csv) 
Array [ {…} ]
settingsplugin.ts:42:18
This may happen if {autoStart: false} in (@jupyterlab/csvviewer-extension:csv) or if it is one of the deferredExtensions in page config. settingsplugin.ts:44:20
Settings failed to load for (@jupyterlab/csvviewer-extension:tsv) 
Array [ {…} ]
settingsplugin.ts:42:18
This may happen if {autoStart: false} in (@jupyterlab/csvviewer-extension:tsv) or if it is one of the deferredExtensions in page config. settingsplugin.ts:44:20
Settings failed to load for (@jupyterlab/filebrowser-extension:widget) 
Array [ {…} ]
settingsplugin.ts:42:18
This may happen if {autoStart: false} in (@jupyterlab/filebrowser-extension:widget) or if it is one of the deferredExtensions in page config. settingsplugin.ts:44:20
Settings failed to load for (@jupyterlab/fileeditor-extension:plugin) 
Array [ {…} ]
settingsplugin.ts:42:18
This may happen if {autoStart: false} in (@jupyterlab/fileeditor-extension:plugin) or if it is one of the deferredExtensions in page config. settingsplugin.ts:44:20
Settings failed to load for (@jupyterlab/htmlviewer-extension:plugin) 
Array [ {…} ]
settingsplugin.ts:42:18
This may happen if {autoStart: false} in (@jupyterlab/htmlviewer-extension:plugin) or if it is one of the deferredExtensions in page config. settingsplugin.ts:44:20
Error: Dynamic module import is disabled or not supported in this context python_data.js:3:1
Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason: Control comm did not respond in time 150.b0e841b75317744a7595.js:1:5783
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:283:23
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:638:29
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:1387:31
Erreur d’analyse de la valeur pour « -webkit-transition-duration ».  Déclaration abandonnée. notebooks:1529:31
Erreur d’analyse de la valeur pour « transition-duration ».  Déclaration abandonnée. notebooks:1530:31
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1587:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1588:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1605:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1606:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1863:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1864:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1879:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1880:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1900:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1901:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1916:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1917:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1937:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1938:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1953:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1954:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1974:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1975:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:1990:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:1991:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:2016:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:2017:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:2034:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:2035:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:2060:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:2061:32
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:2078:32
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:2079:32
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2291:28
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2294:28
Pseudo-classe ou pseudo-élément « -ms-clear » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2302:28
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:2586:25
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:2652:25
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2807:72
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2824:84
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2880:26
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2883:26
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2929:35
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2934:35
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2939:35
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2947:37
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2982:38
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:2984:38
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3006:47
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3008:47
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3012:47
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3017:47
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3023:49
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3025:46
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:3157:31
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3334:14
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3337:14
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3389:26
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3391:26
Pseudo-classe ou pseudo-élément « -ms-clear » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3502:14
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3521:34
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:3523:34
Pseudo-classe ou pseudo-élément « -ms-expand » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:4027:27
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:4070:27
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:4281:27
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:4291:27
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:4302:29
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:5929:29
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:5963:31
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6258:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6259:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6270:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6271:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6354:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6355:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6374:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6375:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6394:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6395:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6414:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6415:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6496:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6497:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6516:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6517:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6536:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6537:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6556:28
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6557:28
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6674:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6675:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6690:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6691:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6721:34
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6722:34
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6737:34
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6738:34
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6795:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6796:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:6807:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:6808:30
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:7284:25
Erreur d’analyse de la valeur pour « -webkit-transform ».  Déclaration abandonnée. notebooks:7299:34
Erreur d’analyse de la valeur pour « transform ».  Déclaration abandonnée. notebooks:7300:34
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:7388:25
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:7596:29
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:7687:27
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:7751:47
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:7753:47
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:7786:20
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:7789:20
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:7819:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:7820:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:7835:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:7836:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:7853:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:7854:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:8087:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:8088:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:8103:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:8104:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:21:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:22:30
Erreur d’analyse de la valeur pour « -webkit-transition-delay ».  Déclaration abandonnée. notebooks:39:30
Erreur d’analyse de la valeur pour « transition-delay ».  Déclaration abandonnée. notebooks:40:30
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:51:23
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:5:54
Erreur d’analyse de la valeur pour « overflow ».  Déclaration abandonnée. notebooks:78:13
Pseudo-classe ou pseudo-élément « -ms-input-placeholder » inconnu.  Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:121:26
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:56:23
Propriété « -moz-outline-radius » inconnue.  Déclaration abandonnée. notebooks:67:23
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:48:61
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:55:61
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:84:51
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:90:51
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:108:45
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:113:45
Propriété « -moz-border-radius » inconnue.  Déclaration abandonnée. notebooks:244:22
Erreur d’analyse de la valeur pour « content ».  Déclaration abandonnée. notebooks:1:174
Jeu de règles ignoré suite à un mauvais sélecteur. notebooks:1:1318
Erreur d’analyse de la valeur pour « display ».  Déclaration abandonnée. notebooks:1:2750
Propriété « -moz-osx-font-smoothing » inconnue.  Déclaration abandonnée. notebooks:11:27
Propriété « -moz-box-shadow » inconnue.  Déclaration abandonnée. notebooks:504:19
Default kernel not found, using 'xeus-python' 13 validate.ts:73:12

build fails on Windows11/conda FileNotFoundError

Description

Build fails with:
FileNotFoundError: [Errno 2] No such file or directory: '\tmp\xeus-python-kernel\envs\xeus-python-kernel\Scripts/pip-script.py'

Reproduce

  1. conda install -c conda-forge jupyterlite-xeus-python
  2. jupyter lite build

Error:
Executing transaction: done
[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus-python] [ERR] [Errno 2] No such file or directory: '\tmp\xeus-python-kernel\envs\xeus-python-kernel\Scripts/pip-script.py'
Traceback (most recent call last):
File "C:\Users\DavidNilsson\anaconda3\envs\xeus-python-kernel\Lib\site-packages\doit\doit_cmd.py", line 294, in run
return command.parse_execute(args)
...
File "C:\Users\DavidNilsson\anaconda3\Lib\shutil.py", line 256, in copyfile
with open(src, 'rb') as fsrc:
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '\tmp\xeus-python-kernel\envs\xeus-python-kernel\Scripts/pip-script.py'

Expected behavior

Two issues,

  1. it's looking for a linux \tmp style path while on Windows it's on (in the log):
    environment location: C:\tmp\xeus-python-kernel\envs\xeus-python-kernel
  2. The folder and file Scripts/pip-script.py doesn't exist in C:\tmp\xeus-python-kernel...

Context

  • JupyterLite version:
  • jupyterlite-app-0.1.2
  • jupyterlite-xeus-python-0.9.6
  • python=3.10
  • xeus-python=0.15.9
  • anaconda3
  • Operating System and version: Windows 11
  • Browser and version: N/A

Building with the jupyterlite with pyodide-kernel works fine, but not with Xeus.
Tried multiple conda env setups, same issue.
Logs attached. Please advise.
XeusBuildIssueFileNotFound.txt

Support `requirements.txt`

Problem

Currently jupyterlite-xeus-python supports reading dependencies from an environment.yml file which is great 👍

However some folks new to Python and likely to use JupyterLite might not be familiar with the whole conda world of packages. This might not be an issue if they are just using an existing JupyterLite site. However it could become one if they want to build their own site.

Proposed Solution

Maybe the kernel addon could also support reading dependencies from a requirements.txt if available. And "translate" it to an environment.yml transparently before triggering the build.

This might need #102 first, as not all packages on PyPI are available on conda-forge.

Additional context

This came up in discussions after the presentation about JupyterLite at a Python meetup: https://www.meetup.com/fr-FR/groupe-dutilisateurs-python-grenoble/events/291818929/

Upgrade to 0.9.0 results in `package is excluded by strict repo priority`

Description

Upgrading to xeus-python-kernel>0.9.0 breaks the build process of our site, throwing this error:

- package 'bw2io-0.9.dev21-py_0' is excluded by strict repo priority
Full Output
[LiteBuildApp] No archive (yet): brightway-hub-jupyterlite.tgz
[LiteBuildApp]     jupyter-lite.(json|ipynb): 1 files
/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_core/optional.py:22: UserWarning: install libarchive-c for better perfomance when working with archives: No module named 'libarchive'
  warnings.warn(hint.format(error=error))
/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_core/optional.py:22: UserWarning: [lite] [translation] install `jupyterlab_server` to load translations: No module named 'jupyterlab_server'
  warnings.warn(hint.format(error=error))

                                           __
          __  ______ ___  ____ _____ ___  / /_  ____ _
         / / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
        / /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
       / .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
      /_/

error    libmamba Error opening for writing "/tmp/xeus-python-kernel/envs/xeus-python-kernel/.mambarc": No such file or directory
error    libmamba Selected channel specific (or force-reinstall) job, but package is not available from channel. Solve job will fail.
error    libmamba Selected channel specific (or force-reinstall) job, but package is not available from channel. Solve job will fail.
Encountered problems while solving:
  - package 'bw2io-0.9.dev21-py_0' is excluded by strict repo priority

The environment can't be solved, aborting the operation
error    libmamba Could not solve for environment specs
critical libmamba UnsatisfiableError
[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus-python] [ERR] Command '['/home/runner/micromamba-bin/micromamba', 'create', '--yes', '--root-prefix', '/tmp/xeus-python-kernel', '--name', 'xeus-python-kernel', '--platform=emscripten-32', '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'https://repo.mamba.pm/conda-forge', '-c', 'https://conda.anaconda.org/conda-forge', '-c', 'nodefaults', 'python=3.10', 'xeus-lite', 'xeus-python=0.15.9', 'pandas', 'numpy', 'matplotlib', 'https://repo.mamba.pm/emscripten-forge::peewee', 'https://repo.mamba.pm/emscripten-forge::lxml', 'https://conda.anaconda.org/cmutel::bw2io=0.9.dev21', 'https://conda.anaconda.org/cmutel::bw2data=4.0.0.dev21', 'https://conda.anaconda.org/cmutel::bw2calc=1.0.dev13']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/doit_cmd.py", line 294, in run
    return command.parse_execute(args)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/cmd_base.py", line 150, in parse_execute
    return self.execute(params, args)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/cmd_base.py", line 570, in execute
    return self._execute(**exec_params)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/cmd_run.py", line 265, in _execute
    return runner.run_all(self.control.task_dispatcher())
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/runner.py", line 254, in run_all
    self.run_tasks(task_dispatcher)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/runner.py", line 213, in run_tasks
    node = task_dispatcher.generator.send(node)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/control.py", line 629, in _dispatcher_generator
    next_step = node.step()
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/control.py", line 336, in step
    return next(self.generator)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/control.py", line 345, in _func
    for value in decorated(*args, **kwargs):
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/doit/control.py", line 473, in _add_task
    new_tasks = generate_tasks(to_load, task_gen, ref.__doc__)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/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-root/envs/build-env/lib/python3.10/site-packages/doit/loader.py", line 27, in flat_generator
    for item in gen:
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_core/manager.py", line 145, in _delayed_gather
    for task in _gather():
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_core/manager.py", line 138, in _gather
    raise error
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_core/manager.py", line 128, in _gather
    for task in getattr(addon, attr)(self):
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_xeus_python/env_build_addon.py", line 79, in post_build
    env_prefix = build_and_pack_emscripten_env(
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_xeus_python/build.py", line 249, in build_and_pack_emscripten_env
    raise e
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_xeus_python/build.py", line 193, in build_and_pack_emscripten_env
    create_env(env_name, root_prefix, specs, channels)
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/site-packages/jupyterlite_xeus_python/build.py", line 69, in create_env
    run(
  File "/home/runner/micromamba-root/envs/build-env/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/runner/micromamba-bin/micromamba', 'create', '--yes', '--root-prefix', '/tmp/xeus-python-kernel', '--name', 'xeus-python-kernel', '--platform=emscripten-32', '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'https://repo.mamba.pm/conda-forge', '-c', 'https://conda.anaconda.org/conda-forge', '-c', 'nodefaults', 'python=3.10', 'xeus-lite', 'xeus-python=0.15.9', 'pandas', 'numpy', 'matplotlib', 'https://repo.mamba.pm/emscripten-forge::peewee', 'https://repo.mamba.pm/emscripten-forge::lxml', 'https://conda.anaconda.org/cmutel::bw2io=0.9.dev21', 'https://conda.anaconda.org/cmutel::bw2data=4.0.0.dev21', 'https://conda.anaconda.org/cmutel::bw2calc=1.0.dev13']' returned non-zero exit status 1.
static:jupyter-lite.json
.  pre_status:static:jupyter-lite.json
    tarball:         jupyterlite-app-0.1.1.tgz 7MB
    output:          /home/runner/work/brightway-hub/brightway-hub/dist
    lite dir:        /home/runner/work/brightway-hub/brightway-hub
    apps:            
    sourcemaps:      True
    unused packages: True
archive:archive
contents:contents
lite:jupyter-lite.json
mathjax:status
mimetypes:jupyter-lite.json
serve:contents
settings:overrides
translation:translation
.  status:archive:archive
.  status:contents:contents
    contents: 3 files
.  status:lite:jupyter-lite.json
.  status:mathjax:status
     jupyter-server-mathjax: None 
     configured MathJax dir: /home/runner/work/brightway-hub/brightway-hub/traitlets.Undefined
     effective MathJax dir: None
.  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: 0 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-python-kernel
.  pre_build:federated_extensions:copy:ext:jupyterlab_pygments
.  pre_build:federated_extensions:copy:ext:@jupyterlite/xeus-python-kernel
contents:copy:README.md
contents:copy:demo.ipynb
contents:copy:peewee_test.ipynb
lite:patch:jupyter-lite.json
translation:copy
.  build:contents:copy:README.md
.  build:contents:copy:demo.ipynb
.  build:contents:copy:peewee_test.ipynb
.  build:lite:patch:jupyter-lite.json
MERGED /home/runner/work/brightway-hub/brightway-hub/dist/jupyter-lite.json from [PosixPath('/home/runner/work/brightway-hub/brightway-hub/dist/jupyter-lite.json'), PosixPath('/home/runner/work/brightway-hub/brightway-hub/jupyter-lite.json')]
.  build:translation:copy
contents:contents:.
federated_extensions:patch
jupyterlite-xeus-python:xeus:copy:ext:@jupyterlite/xeus-python-kernel
Error: Process completed with exit code 3.

Reproduce

For a working version, compare branch main of our repo.
For the broken version, compare branch environment_upgrade branch of our repo.

build-environment.yml (this breaks the site build):

name: build-env
channels:
  - conda-forge
dependencies:
  - python=3.10
  - jupyter_server=2.7.1 # https://anaconda.org/conda-forge/jupyter_server/files
  - jupyterlite-core==0.1.1 # https://anaconda.org/conda-forge/jupyterlite-core/files
  - jupyterlite-xeus-python==0.9.0 # https://anaconda.org/conda-forge/jupyterlite-xeus-python/files

build-environment.yml (this works fine):

name: build-env
channels:
  - conda-forge
dependencies:
  - python=3.10
  - jupyter_server=2.7.1 # https://anaconda.org/conda-forge/jupyter_server/files
  - jupyterlite-core==0.1.1 # https://anaconda.org/conda-forge/jupyterlite-core/files
  - pip
  - pip:
    - jupyterlite-xeus-python==0.8.1 # https://github.com/jupyterlite/xeus-python-kernel/releases

environment.yml:

name: xeus-python-kernel
channels:
  - https://repo.mamba.pm/emscripten-forge # check packages at https://beta.mamba.pm/channels
  - https://conda.anaconda.org/conda-forge
  - nodefaults
dependencies:
  # DATA SCIENCE
  - pandas
  - numpy
  # PLOTTING
  - matplotlib
  # BRIGHTWAY DEPENDENCIES (NOT PURE PYTHON)
  - https://repo.mamba.pm/emscripten-forge::peewee # required by Brightway
  - https://repo.mamba.pm/emscripten-forge::lxml # required by Brightway
  # BRIGHTWAY CORE
  - https://conda.anaconda.org/cmutel::bw2io=0.9.dev21 # https://anaconda.org/cmutel/bw2io/files
  - https://conda.anaconda.org/cmutel::bw2data=4.0.0.dev21 # https://anaconda.org/cmutel/bw2data/files
  - https://conda.anaconda.org/cmutel::bw2calc=1.0.dev13 # https://anaconda.org/cmutel/bw2calc/files

Expected behavior

Site build completes successfully.

Context

  • JupyterLite version: 0.1.1
  • Operating System and version: N/A (GH Actions WF)
  • Browser and version: Version 16.6 (18615.3.12.11.2)
Browser Output
Paste the output from your browser Javascript console here.

Path('.').is_dir() returns False in XPython kernel

Description

pathlib.Path('.').is_dir() incorrectly returns False when run in XPython kernel.

Since Pandas use is_dir() in file path checking, some Pandas I/O methods like DataFrame.to_csv() fails in XPython with the error Cannot save file into a non-existent directory: '.'

Reproduce

  1. Create new notebook using XPython kernel
  2. Run this code in a cell:
from pathlib import Path
Path('.').is_dir()
  1. See incorrect result False

Expected behavior

The result of above cell should be True as it is in the Pyodide kernel.

Context

  • JupyterLite version: 0.1.0-beta.15
  • jupyterlite-xeus-python version: 0.5.6
  • Operating System and version: Ubuntu 22.04 LTS (WSL)
  • Browser and version: Chrome Version 108.0.5359.71 (Official Build) (64-bit)

Compatibility with "ignore_sys_prefix"

Description

I'm trying to use this jupyterlite addon in a custom jupyterlite deployment built via jupyterlite-sphinx. However, I'm struggling to get it working and I'm wondering if it's not related to the way this addon behaves with the ignore-sys-prefix JupyterLite setting. None of the values set below for this setting yields the expected results (I guess?).

Reproduce

My custom jupyter lite build is very similar to the example given in this documentation and the one used for the ipycanvas documentation. I use the following packages:

  "XeusPythonEnv": {
    "packages": ["numpy", "matplotlib", "ipytone", "jupyterlab_widgets", "traitlets", "traittypes", "ipywidgets"]
  },

1. Using ignore-sys-prefix: true

  • No xeus-python kernel visible in the list of kernels and no federated extension copied into the JupyterLite build

  • Content of build/html/lite/jupyter-lite.json:

{
  "jupyter-config-data": {
    "appName": "JupyterLite",
    "appUrl": "./lab",
    "appVersion": "0.1.0-beta.7",
    "baseUrl": "./",
    "faviconUrl": "./lab/favicon.ico",
    "federated_extensions": [],
    "fullLabextensionsUrl": "./extensions",
    "fullMathjaxUrl": "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js",
    "fullStaticUrl": "./build",
    "licensesUrl": "./lab/api/licenses",
    "mathjaxConfig": "TeX-AMS_CHTML-full,Safe",
    "preferredPath": "/"
  },
  "jupyter-lite-schema-version": 0
}%
  • Content of build/html/lite/extensions directory:
@jupyterlite/xeus-python-kernel

2. Using ignore-sys-prefix: []

  • xeus-python kernel visible in the list of kernels and all federated extensions installed in my environment copied into the JupyterLite build (which is not what I expect and which may have different versions than the versions installed in the xeus environment)

  • Content of build/html/lite/jupyter-lite.json:

{
  "jupyter-config-data": {
    "appName": "JupyterLite",
    "appUrl": "./lab",
    "appVersion": "0.1.0-beta.7",
    "baseUrl": "./",
    "faviconUrl": "./lab/favicon.ico",
    "federated_extensions": [
        {
            "extension": "./extension",
            "liteExtension": true,
            "load": "static/remoteEntry.7363ca86b6eb68446da2.js",
            "name": "@jupyterlite/xeus-python-kernel",
            "style": "./style"
        },
        ... all extensions from my jupyterlab env ...
    ],
    "fullLabextensionsUrl": "./extensions",
    "fullMathjaxUrl": "./static/jupyter_server_mathjax/MathJax.js",
    "fullStaticUrl": "./build",
    "licensesUrl": "./lab/api/licenses",
    "mathjaxConfig": "TeX-AMS-MML_HTMLorMML-full,Safe",
    "preferredPath": "/"
  },
  "jupyter-lite-schema-version": 0
}%
  • Content of build/html/lite/extensions directory:
@jupyterlite/xeus-python-kernel
+ all extensions from my jupyterlab env

3. Using ignore-sys-prefix: ["jupyterlite-xeus-python"]

Same results than with 2.

4. Using ignore-sys-prefix: ["federated_extensions"]

  • No xeus-python kernel visible in the list of kernels and but the expected federated extensions are copied into the JupyterLite build

  • Content of build/html/lite/jupyter-lite.json:

{
  "jupyter-config-data": {
    "appName": "JupyterLite",
    "appUrl": "./lab",
    "appVersion": "0.1.0-beta.7",
    "baseUrl": "./",
    "faviconUrl": "./lab/favicon.ico",
    "federated_extensions": [
      {
        "extension": "./extension",
        "liteExtension": false,
        "load": "static/remoteEntry.3421943a0ce73f10909d.js",
        "name": "@jupyter-widgets/jupyterlab-manager"
      },
      {
        "extension": "./extension",
        "liteExtension": false,
        "load": "static/remoteEntry.31dd2990580e09632145.js",
        "name": "ipytone"
      }
    ],
    "fullLabextensionsUrl": "./extensions",
    "fullMathjaxUrl": "./static/jupyter_server_mathjax/MathJax.js",
    "fullStaticUrl": "./build",
    "licensesUrl": "./lab/api/licenses",
    "mathjaxConfig": "TeX-AMS-MML_HTMLorMML-full,Safe",
    "preferredPath": "/"
  },
  "jupyter-lite-schema-version": 0
}%
  • Content of build/html/lite/extensions directory:
@jupyterlite/xeus-python-kernel   # although not all files are present (remoteEntry, etc.)
@jupyter-widgets
ipytone

Expected behavior

  • xeus-python kernel visible in the list of kernels.
  • Only the (non-jupyterlite) federated extensions installed from XeusPythonEnv packages copied into the JupyterLite build

Context

  • JupyterLite version: 0.1.0b7
  • Jupyterlite-sphinx: 0.4.7 (with patch so that the build completes #21)
  • jupyterlite-xeus-python: 0.3.0

`UserWarning: I/O error(44): No such file or directory` when importing `pandas`

Currently importing pandas gives the following warning:

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages/dateutil/zoneinfo/__init__.py:26: UserWarning: I/O error(44): No such file or directory
  warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))

This does not seem to be the case with Pyodide:

image

In this example the version is not exactly the same which might explain the difference (although unlikely?).

Test critical packages on CI

To make sure the new packages can be used correctly in the xeus python kernel, we should add a UI test that imports popular packages like scipy to make sure they work properly.

Remove dependency on the Anaconda website.

Description

During the build, using this command in Miniforge, jupyter lite build --XeusPythonEnv.packages=ipyvuetify,ipywidgets,ipyflex, numpy, plotly, pandas I get the following error message (see below). I believe this is because of the settings on my company laptop that prohibits me from visiting the Anaconda website. Is there a way I could get around this issue?

Error message:

emscripten-forge/emscrip Using cache
emscripten-forge/noarch Using cache
conda-forge/emscripten-3 [====================] (00m:00s) 404 Failed
pkgs/main/noarch [> ] (00m:08s) Failure when receiving data from the peer
pkgs/r/emscripten-32 [> ] (00m:08s) Failure when receiving data from the peer
pkgs/main/emscripten-32 [> ] (00m:08s) Failure when receiving data from the peer
pkgs/r/noarch [> ] (00m:07s) Failure when receiving data from the peer
pkgs/msys2/emscripten-32 [> ] (00m:07s) Failure when receiving data from the peer
pkgs/msys2/noarch [> ] (00m:07s) Failure when receiving data from the peer
conda-forge/noarch [ ] (00m:04s) 2 MB / ?? (236.52 KB/s)

ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\conda\exceptions.py", line 1080, in __call__
    return func(*args, **kwargs)
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\mamba.py", line 898, in exception_converter
    raise e
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\mamba.py", line 892, in exception_converter
    exit_code = _wrapped_main(*args, **kwargs)
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\mamba.py", line 851, in _wrapped_main
    result = do_call(args, p)
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\mamba.py", line 732, in do_call
    exit_code = install(args, parser, "install")
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\mamba.py", line 515, in install
    index = load_channels(pool, channels, repos)
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\utils.py", line 106, in load_channels
    use_cache=use_cache,
  File "C:\Users\reddeda\AppData\Local\Continuum\miniconda3\lib\site-packages\mamba\utils.py", line 81, in get_index        is_downloaded = dlist.download(True)
RuntimeError: Download error (56) Failure when receiving data from the peer [**https://repo.anaconda.com/pkgs/main/noarch/repodata.json**]
Received HTTP code 403 from proxy after CONNECT

When I tried to execute a simple Python code on a local standalone server, the code never succeeds forever.

Description

When I tried to execute a simple Python code, "from IPython.display import display" on the xeus kernel, the code never succeeds forever.

image

Reproduce

  1. I installed JupyterLite locally by https://jupyterlite.readthedocs.io/en/latest/quickstart/standalone.html.
  2. I tried a hosting on the localhost URL with 8000 port by the command, "jupyter lite serve".
  3. When I tried to execute a simple Python code, "from IPython.display import display" on the xeus kernel, the code never succeeds forever.

Expected behavior

The simple code should be succeeded.

Context

  • JupyterLite version: 0.1.0
  • Operating System and version: mac 10.15.7
  • Browser and version: chrome 113.0.5672.126
Browser Output
image

`import nbformat` gives: `TypeError: expected string or bytes-like object`

Description

Building a fresh JupyterLite site with nbformat as a dependency gives the following issue:

image

Reproduce

  1. Create environment.yml with the following content:
name: test
channels:
- https://repo.mamba.pm/emscripten-forge
- https://repo.mamba.pm/conda-forge
dependencies:
- nbformat
  1. Create a new virtual environment for the build
  2. python -m pip install jupyterlite-xeus-python
  3. jupyter lite build
  4. jupyter lite serve
  5. Open http://localhost:8000/_output/lab/index.html

Expected behavior

It should be possible to import nbformat.

Context

This came up when checking if plotly works with the xeus python kernel in JupyterLite:

import plotly.graph_objects as go

fig = go.Figure()
fig.add_trace(go.Scatter(y=[2, 1, 4, 3]))
fig.add_trace(go.Bar(y=[1, 4, 3, 2]))
fig.update_layout(title="Hello Figure")
fig.show()

image

Add UI-tests

Problem

We need to add some tests for the kernel:

  • Make sure it shows up in the JupyterLite UI
  • Make sure it can execute code and have access to the file system

Windows not supported?

It's seems that packing the environment with empack does not work on windows. We should add some CI on Windows and check this.

xeus-python kernel doesn't start if packages are installed

Reproduce

git clone https://github.com/yuvipanda/requirements
cd requirements
jupyter lite build . --output-dir _output --contents . --config jupyterlite_config.json
cd _output
python3 -m http.server 9000

Go to localhost:9000, see jupyterlite. Try to start the xpython kernel, it never starts. If you type print("hello world") it never runs.

The relevant part of the repo is jupyterlite_config.json, which is:

{
    "XeusPythonEnv": {
        "packages": ["numpy", "matplotlib", "ipyleaflet", "flask"]
    }
}

Expected behavior

I can run python code, as well as install additional packages.

Context

Output of pip list:

Package                 Version            Editable project location
----------------------- ------------------ --------------------------------------
alembic                 1.8.0
anyio                   3.6.1
appnope                 0.1.3
argon2-cffi             21.3.0
argon2-cffi-bindings    21.2.0
asttokens               2.0.5
async-generator         1.10
attrs                   21.4.0
Babel                   2.10.3
backcall                0.2.0
beautifulsoup4          4.11.1
binderhub               0.2.0+979.g2d15492
black                   22.6.0
bleach                  5.0.1
cachetools              5.2.0
certifi                 2022.6.15
certipy                 0.1.3
cffi                    1.15.1
chardet                 5.0.0
charset-normalizer      2.1.0
click                   8.1.3
cloudpickle             2.1.0
commonmark              0.9.1
cryptography            37.0.2
debugpy                 1.6.0
decorator               5.1.1
defusedxml              0.7.1
docker                  5.0.3
docutils                0.18.1
doit                    0.36.0
empack                  0.7.1
entrypoints             0.4
escapism                1.0.1
executing               0.8.3
fastapi                 0.78.0
fastjsonschema          2.15.3
flake8                  4.0.1
google-auth             2.9.0
greenlet                1.1.2
h11                     0.13.0
httptools               0.4.0
idna                    3.3
importlib-metadata      4.12.0
ipykernel               6.15.0
ipython                 8.4.0
ipython-genutils        0.2.0
iso8601                 1.0.2
jedi                    0.18.1
Jinja2                  3.1.2
json5                   0.9.8
jsonschema              4.6.1
jupyter-client          7.3.4
jupyter-core            4.10.0
jupyter-repo2docker     2022.2.0
jupyter-server          1.18.0
jupyter-telemetry       0.1.0
jupyterhub              2.3.1
jupyterlab              3.4.3
jupyterlab-pygments     0.2.2
jupyterlab-server       2.14.0
jupyterlite             0.1.0b10
jupyterlite-xeus-python 0.5.1
keyring                 23.6.0
kubernetes              24.2.0
Mako                    1.2.1
MarkupSafe              2.1.1
matplotlib-inline       0.1.3
mccabe                  0.6.1
mistune                 0.8.4
mypy-extensions         0.4.3
nbclassic               0.3.7
nbclient                0.6.6
nbconvert               6.5.0
nbformat                5.4.0
nest-asyncio            1.5.5
notebook                6.4.12
notebook-shim           0.1.0
oauthlib                3.2.0
packaging               21.3
pamela                  1.0.0
pandocfilters           1.5.0
parso                   0.8.3
pathspec                0.9.0
pexpect                 4.8.0
pickleshare             0.7.5
pip                     22.0.4
pkginfo                 1.8.3
platformdirs            2.5.2
prometheus-client       0.14.1
prompt-toolkit          3.0.30
psutil                  5.9.1
ptyprocess              0.7.0
pure-eval               0.2.2
pyasn1                  0.4.8
pyasn1-modules          0.2.8
pycodestyle             2.8.0
pycparser               2.21
pydantic                1.9.1
pyflakes                2.4.0
Pygments                2.12.0
PyJWT                   2.4.0
pyOpenSSL               22.0.0
pyparsing               3.0.9
pyrsistent              0.18.1
python-dateutil         2.8.2
python-dotenv           0.20.0
python-json-logger      2.0.2
pytz                    2022.1
PyYAML                  6.0
pyzmq                   23.2.0
readme-renderer         35.0
repo2jupyterlite        0.1                /Users/yuvipanda/code/repo2jupyterlite
requests                2.28.1
requests-oauthlib       1.3.1
requests-toolbelt       0.9.1
rfc3986                 2.0.0
rich                    12.4.4
rsa                     4.8
ruamel.yaml             0.17.21
ruamel.yaml.clib        0.2.6
semver                  2.13.0
Send2Trash              1.8.0
setuptools              60.10.0
six                     1.16.0
sniffio                 1.2.0
soupsieve               2.3.2.post1
SQLAlchemy              1.4.39
stack-data              0.3.0
starlette               0.19.1
terminado               0.15.0
tinycss2                1.1.1
toml                    0.10.2
tomli                   2.0.1
tornado                 6.1
traitlets               5.3.0
twine                   4.0.1
typer                   0.4.1
typing_extensions       4.3.0
urllib3                 1.26.9
uvicorn                 0.18.2
uvloop                  0.16.0
versioneer              0.22
watchfiles              0.15.0
wcwidth                 0.2.5
webencodings            0.5.1
websocket-client        1.3.3
websockets              10.3
wheel                   0.37.1
zipp                    3.8.0

Am not using conda or anything.

  • JupyterLite version:
  • Operating System and version: Mac OS
  • Browser and version: Firefox
Browser Output
Paste the output from your browser Javascript console here.
warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available. [xpython_wasm.js:9:206004](http://localhost:9000/_output/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.js) make_xkernel 1 [xpython_wasm.js:9:52899](http://localhost:9000/_output/extensions/@jupyterlite/xeus-python-kernel/static/xpython_wasm.js) make_xkernel 2

Inclusion of `wasm`, `tar.gz` and other ignored files in the hatch `shared-data`

As noticed in #181 (comment), there seems to be an issue with hatch not picking up the files listed in .gitignore.

As a result, they are not included in the wheel shared-data and cause issues like #177 since some files are missing.

#181 updated the .gitignore to narrow the scope of the ignored files, so they can be included in the wheel correctly.

However this feels a bit error-prone and it would be easy to get back to the same issue by adding new entries to the .gitignore.

Some next steps would be:

  • make a standalone repo to reproduce this issue
  • open an issue / discussion on https://github.com/pypa/hatch if this is reproducible with the test repo
  • add a check on CI here to make sure files are correctly included. Or run a small UI test with the production build of jupyterlite-xeus-python to make sure the kernel can at least without errors

Package conflicts when trying a build

Description

Package conflicts when trying a build by "jupyter lite build" command

Expected behavior

Should be no error

Context

  • JupyterLite version: jupyter_core : 5.3.0
  • Operating System and version: mac 10.15.7
  • Browser and version:
Build Output
jupyterlite-pyodide-kernel-piplite:patch
jupyterlite-xeus-python:xeus:copy:ext:@jupyterlite/xeus-python-kernel
Collecting package metadata (current_repodata.json): done
Solving environment: done

Package Plan

environment location: /tmp/xeus-python-kernel/envs/xeus-python-kernel

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

To activate this environment, use

$ conda activate /tmp/xeus-python-kernel/envs/xeus-python-kernel

To deactivate an active environment, use

$ conda deactivate

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package python conflicts for:
xeus-python -> ipython -> python[version='>=3.6|>=3.8|>=3.9']
pip -> python[version='>=3|>=3.6|>=3.7']
xeus-python -> python
jupyterlab -> async-lru[version='>=1.0.0'] -> python[version='>=2.7|>=3.4|>=3.9']
pip -> setuptools -> python[version='!=3.0,!=3.1,!=3.2,!=3.3,!=3.4|>=3.8|2.7.*|>=3.6']
jupyterlab -> python[version='>=3.5|>=3.6|>=3.7|>=3.8']

Package packaging conflicts for:
jupyterlab -> packaging
jupyterlab -> jupyterlab_server[version='>=2.19.0,<3'] -> packaging[version='>=21.3']

Package traitlets conflicts for:
jupyterlab -> ipykernel -> traitlets[version='>=4.2.1|>=5.1|>=5.3.0|>=5|>=5.1.0|>=5.4.0|>=5.6.0']
jupyterlab -> traitlets

Package stack_data conflicts for:
xeus-python -> ipython -> stack_data
jupyterlab -> ipython -> stack_data

Package emscripten-abi conflicts for:
xeus-lite -> emscripten-abi=3.1.27
python=3.10 -> emscripten-abi=3.1.27
pip -> python[version='>=3.7'] -> emscripten-abi=3.1.27
xeus-python -> emscripten-abi=3.1.27
jupyterlab -> python[version='>=3.8'] -> emscripten-abi=3.1.27

Package pyparsing conflicts for:
pip -> setuptools -> pyparsing
jupyterlab -> packaging -> pyparsing[version='<3,>=2.0.2|>=2.0.2,!=3.0.5|>=2.0.2,<3|>=2.0.2']

Package wheel conflicts for:
pip -> wheel
jupyterlab -> jupyter-packaging[version='>=0.7,<1'] -> wheel
python=3.10 -> pip -> wheel

Package ipython conflicts for:
jupyterlab -> ipykernel -> ipython[version='>=7.23.1']
jupyterlab -> ipythonThe following specifications were found to be incompatible with your system:

  • jupyterlab -> ipykernel -> __linux
  • jupyterlab -> ipykernel -> __osx
  • jupyterlab -> ipykernel -> __win

Your installed version is: not available

[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus-python] [ERR] Command '['/Users/xxx/miniconda/condabin/conda', 'install', '--yes', '--prefix', PosixPath('/tmp/xeus-python-kernel/envs/xeus-python-kernel'), '-c', 'https://repo.mamba.pm/emscripten-forge', '-c', 'https://repo.mamba.pm/conda-forge', '-c', 'conda-forge', 'python=3.10', 'xeus-lite', 'xeus-python', 'python', 'pip', 'jupyterlab']' returned non-zero exit status 1.

Failed to start the kernel (xeus-python 0.15.9)

Description

Not sure this is the right place to report it, but the very recent deployments of jupyterlite + xeus-python-kernel (last version: 0.15.9) on RTD did not work for me. Jupyterlite is built and deployed without error but the xeus python kernel fails to start when visiting the web page (see browser output below).

Reproduce

Links to a deployment that is not working (using xeus-python 0.15.9):

Links to a deployment that is working (pinning xeus-python <=0.15.7):

Expected behavior

No error when the xeus kernel is initialized.

Context

  • JupyterLite version: 0.1.0
  • Operating System and version: MacOS
  • Browser and version: Firefox 112.0.2 and Chrome 112.0.5615.137
Browser Output

The relevant console logs:

Screenshot 2023-05-02 at 10 42 47

The error is raised here:

Screenshot 2023-05-02 at 10 43 16

Safari Support

Description

It seems that Safari is not working with the JupyterLite version based on the XEUS-Python kernel (even in a Private Window).

Reproduce

  1. Go to Pyodide JL site: https://jupyterlite.github.io/demo/lab/index.html
  2. Try to calculate 1+1
Screenshot 2023-08-25 at 11 42 16
  1. Go to XEUS-Python JL site: https://jupyterlite.github.io/xeus-python-demo/
  2. Try to calculate 1+1
Screenshot 2023-08-25 at 11 40 42

Expected behavior

1+1 can be calculated on JL in Safari.

Context

- python=3.10
- xeus-lite
- xeus-python=0.15.9
- ipycanvas
  • Operating System and version: 13.5.1 (22G90)
  • Browser and version: Safari Version 16.6 (18615.3.12.11.2)
Browser Output
Paste the output from your browser Javascript console here.

Default backend resolution for Matplotlib should be `inline`

Description

With default backend agg, JypyterLite/XPython has trouble to show graphics inline

image

The workaround is to add %matplotlib inline, but this should not be necessary. BTW, this command just sets the Matplotlib backend.

This is how newer JupyterLab/IPython runs the same example

image

And tihis is how JupyterLite/Pyodide runs the same example

image

There is a trick (explained below) how Pyodide kernel does it.

Reproduce

As explained in the description

Expected behavior

Expected behavior is like JupyterLab/IPython behaves (in the above description)

Pyodide kernel paches the matplotlib.pyplot.show function in runtime to enable similar behavior

XPython kernel already behave properly when the Matplnotlib backend is inline since %matplotlib inline sets this backend. We only need to make the inline backend setted initialy.

Matplotlib uses the MPLBACKEND environment variable in the backend resolution

So, it should be enouth to add

os.environ["MPLBACKEND"] = 'module://matplotlib_inline.backend_inline'

somewhere early enough in the XPython kernel. I have tried to figure out where it could be, but I am not familiar how XPython kernel works. I have tested inside a notebook:

image

Context

plt.show() should work without `

  • JupyterLite version: latest
  • Operating System and version: Windows 10
  • Browser and version: Chrome, latest

xeus-python not showing as kernel

Description

cannot run xeus-python-kernel when installed via pip.

Reproduce

mamba create -n myenv    python
mamba activate myenv
python -m pip install jupyterlite
python -m pip install jupyterlite-xeus-python
jupyter lite build
jupyter lite serve
  1. start jupyterlite in browqser
  2. see xeus-python is missing

Expected behavior

xeus being available

Context

  • JupyterLite version:
  • Operating System and version:
  • Browser and version:
Browser Output
Failed to load resource: the server responded with a status of 404 (File not found)
remoteEntry.9bcbbbb4e48c29cec308.js:1 Failed to load resource: the server responded with a status of 404 (File not found)
bootstrap.js:85 EventisTrusted: truebubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: nulldefaultPrevented: falseeventPhase: 0path: (5) [script, head, html, document, Window]returnValue: truesrcElement: scripttarget: scripttimeStamp: 128type: "error"[[Prototype]]: Event
(anonymous) @ bootstrap.js:85
8131.931d811.js:1 Failed to create module: package: @jupyterlite/xeus-python-kernel; module: ./extension
c @ 8131.931d811.js:1
8131.931d811.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'get')
    at c (8131.931d811.js:1)
    at 8131.931d811.js:1
    at Array.forEach ()
    at f (8131.931d811.js:1)
8131.931d811.js:1 TypeError: Cannot read properties of undefined (reading 'get')
    at c (8131.931d811.js:1)
    at 8131.931d811.js:1
    at Array.forEach ()
    at f (8131.931d811.js:1)
(anonymous) @ 8131.931d811.js:1
:8000/api/contents/all.json:1 Failed to load resource: the server responded with a status of 404 (File not found)

Support for installing packages from `environment.yml` files

Problem

At the moment it can be confusing that packages must be specified explicitly in a XeusPythonEnv.packages list.

Folks familiar with Binder might expect dependencies installed in a build environment to also be available in the kernel.

The fact that there could be a mismatch between the frontend extension and the package in the kernel is the issue (for example with widgets).

This is already mentioned in the documentation in the case of the Pyodide kernel: https://jupyterlite.readthedocs.io/en/latest/howto/configure/simple_extensions.html#the-case-of-jupyter-widgets-and-custom-renderers

But also applies for the jupyterlite-xeus-python kernel.

Proposed Solution

For a site deployer, having a single environment.yml would make things more convenient.

It's not clear yet how this should be handle and whether the empack step in the xeus-python addon should accept a environment.yml as is.

The main issue will probably be packages required for the build (for example jupyterlab or jupyter-server to index content) don't need to be installed in the kernel.

Additional context

cc @nthiery since we discussed this use case over a video call

Added the disabledExtensions option into the jupyter-lite.json to opt out two kernels in the UI but it doesn't work.

Description

Added the disabledExtensions option into the jupyter-lite.json to opt out two kernels(Pyodide and Web Worker) in the UI but it doesn't work.

Reproduce

  1. I installed JupyterLite locally by https://jupyterlite.readthedocs.io/en/latest/quickstart/standalone.html.

  2. I tried a hosting on the localhost URL with 8000 port by the command, "jupyter lite serve".

  3. I found there are 3 kernels (Pyodide, Web Worker, XPython) in the main Launcher UI.

  4. I added the disabledExtensions option into the jupyter-lite.json in the _output folder https://jupyterlite.readthedocs.io/en/latest/howto/configure/advanced/extensions.html#disabling-extensions-at-runtime.

    "disabledExtensions": [
    "@jupyterlite/javascript-kernel-extension",
    "@jupyterlite/pyodide-kernel-extension"
    ]

  5. Again I tried a hosting on the localhost URL with 8000 port by the command, "jupyter lite serve".

Expected behavior

Two kernels(pyodide and javascript) should be disappeared in the UI. Only the xeus kernel should be there.
image

Context

  • JupyterLite version: 0.1.0
  • Operating System and version: mac 10.15.7
  • Browser and version: chrome 113.0.5672.126
Browser Output

jupyter lite build broken ?

Description

jupyter lite build gives me an odd error

Reproduce

conda create -y -n jlite-tuto python=3.11
conda activate jlite-tuto

pip install jupyterlite
pip install jupyterlab_server
pip install jupyterlite-xeus-python

mkdir foo
cd foo
jupyter lite init
jupyter lite build

and I'm getting this error (full log below)

ValueError: '/private/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages' is not in the subpath of '/tmp/xeus-python-kernel/envs/xeus-python-kernel' OR one path is relative and the other is absolute.
the full log
jupyter lite build
static:jupyter-lite.json
.  pre_status:static:jupyter-lite.json
    tarball:         jupyterlite-app-0.1.0.tgz 7MB
    output:          /Users/myusername/git/jlite-tuto/foo/_output
    lite dir:        /Users/myusername/git/jlite-tuto/foo
    apps:
    sourcemaps:      True
    unused packages: True
archive:archive
contents:contents
jupyterlite-pyodide-kernel-pyodide:pyodide
lite:jupyter-lite.json
mathjax:status
mimetypes:jupyter-lite.json
serve:contents
settings:overrides
translation:translation
.  status:archive:archive
[LiteBuildApp] No archive (yet): foo-jupyterlite.tgz
.  status:contents:contents
    contents: 0 files
.  status:jupyterlite-pyodide-kernel-pyodide:pyodide
     URL: None
 archive: []
   cache: 0 files
   local: 0 files
.  status:lite:jupyter-lite.json
[LiteBuildApp]     jupyter-lite.(json|ipynb): 0 files
.  status:mathjax:status
     jupyter-server-mathjax: None
     configured MathJax dir: /Users/myusername/git/jlite-tuto/foo/traitlets.Undefined
     effective MathJax dir: None
.  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: 0 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/pyodide-kernel-extension
federated_extensions:copy:ext:@jupyterlite/xeus-python-kernel
federated_extensions:copy:ext:@jupyterlite/javascript-kernel-extension
.  pre_build:federated_extensions:copy:ext:jupyterlab_pygments
.  pre_build:federated_extensions:copy:ext:@jupyterlite/pyodide-kernel-extension
.  pre_build:federated_extensions:copy:ext:@jupyterlite/xeus-python-kernel
.  pre_build:federated_extensions:copy:ext:@jupyterlite/javascript-kernel-extension
translation:copy
.  build:translation:copy
federated_extensions:patch
jupyterlite-pyodide-kernel-piplite:patch
jupyterlite-xeus-python:xeus:copy:ext:@jupyterlite/xeus-python-kernel
Collecting package metadata (current_repodata.json): done
Solving environment: done

Package Plan

environment location: /tmp/xeus-python-kernel/envs/xeus-python-kernel

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

To activate this environment, use

$ conda activate /tmp/xeus-python-kernel/envs/xeus-python-kernel

To deactivate an active environment, use

$ conda deactivate

Collecting package metadata (current_repodata.json): done
Solving environment: |
Warning: >10 possible package resolutions (only showing differing packages):

Package Plan

environment location: /tmp/xeus-python-kernel/envs/xeus-python-kernel

added / updated specs:
- python=3.10
- xeus-lite
- xeus-python=0.15.9

The following NEW packages will be INSTALLED:

asttokens conda-forge/noarch::asttokens-2.2.1-pyhd8ed1ab_0
backcall conda-forge/noarch::backcall-0.2.0-pyh9f0ad1d_0
backports conda-forge/noarch::backports-1.0-pyhd8ed1ab_3
backports.functoo~ conda-forge/noarch::backports.functools_lru_cache-1.6.5-pyhd8ed1ab_0
decorator conda-forge/noarch::decorator-5.1.1-pyhd8ed1ab_0
emscripten-abi emscripten-forge/noarch::emscripten-abi-3.1.27-hb0f4dca_6
executing conda-forge/noarch::executing-1.2.0-pyhd8ed1ab_0
ipython emscripten-forge/emscripten-32::ipython-8.14.0-py310h8bed8af_1
jedi conda-forge/noarch::jedi-0.18.2-pyhd8ed1ab_0
matplotlib-inline conda-forge/noarch::matplotlib-inline-0.1.6-pyhd8ed1ab_0
numpy emscripten-forge/emscripten-32::numpy-1.25.1-py310h6d2fff6_0
parso conda-forge/noarch::parso-0.8.3-pyhd8ed1ab_0
pexpect conda-forge/noarch::pexpect-4.8.0-pyh1a96a4e_2
pickleshare conda-forge/noarch::pickleshare-0.7.5-py_1003
pip conda-forge/noarch::pip-23.2.1-pyhd8ed1ab_0
prompt-toolkit conda-forge/noarch::prompt-toolkit-3.0.39-pyha770c72_0
ptyprocess conda-forge/noarch::ptyprocess-0.7.0-pyhd3deb0d_0
pure_eval conda-forge/noarch::pure_eval-0.2.2-pyhd8ed1ab_0
pygments conda-forge/noarch::pygments-2.15.1-pyhd8ed1ab_0
pyparsing conda-forge/noarch::pyparsing-3.1.0-pyhd8ed1ab_0
python emscripten-forge/emscripten-32::python-3.10.2-h_hash_26_cpython
requests-wasm-pol~ emscripten-forge/emscripten-32::requests-wasm-polyfill-0.3.0-h8bed8af_0
setuptools emscripten-forge/emscripten-32::setuptools-64.0.0-py310h8bed8af_0
six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
stack_data conda-forge/noarch::stack_data-0.6.2-pyhd8ed1ab_0
traitlets conda-forge/noarch::traitlets-5.9.0-pyhd8ed1ab_0
wcwidth conda-forge/noarch::wcwidth-0.2.6-pyhd8ed1ab_0
wheel conda-forge/noarch::wheel-0.41.0-pyhd8ed1ab_0
xeus-lite emscripten-forge/emscripten-32::xeus-lite-1.0.1-hf0acc6b_0
xeus-python emscripten-forge/emscripten-32::xeus-python-0.15.9-h4d17c68_1
xeus-python-shell conda-forge/noarch::xeus-python-shell-0.6.0-pyhd8ed1ab_0
xeus-python-shell~ conda-forge/noarch::xeus-python-shell-raw-0.6.0-pyhd8ed1ab_0

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
[LiteBuildApp] ERROR | [lite] [post_build] [jupyterlite-xeus-python] [ERR] '/private/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages' is not in the subpath of '/tmp/xeus-python-kernel/envs/xeus-python-kernel' OR one path is relative and the other is absolute.
Traceback (most recent call last):
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/doit_cmd.py", line 294, in run
return command.parse_execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/cmd_base.py", line 150, in parse_execute
return self.execute(params, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/cmd_base.py", line 570, in execute
return self._execute(**exec_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/cmd_run.py", line 265, in _execute
return runner.run_all(self.control.task_dispatcher())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/runner.py", line 254, in run_all
self.run_tasks(task_dispatcher)
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/runner.py", line 213, in run_tasks
node = task_dispatcher.generator.send(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/control.py", line 629, in _dispatcher_generator
next_step = node.step()
^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/control.py", line 336, in step
return next(self.generator)
^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/control.py", line 345, in _func
for value in decorated(*args, **kwargs):
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/control.py", line 473, in _add_task
new_tasks = generate_tasks(to_load, task_gen, ref.doc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/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 "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/doit/loader.py", line 27, in flat_generator
for item in gen:
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/jupyterlite_core/manager.py", line 145, in _delayed_gather
for task in _gather():
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/jupyterlite_core/manager.py", line 138, in _gather
raise error
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/jupyterlite_core/manager.py", line 128, in _gather
for task in getattr(addon, attr)(self):
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/jupyterlite_xeus_python/env_build_addon.py", line 82, in post_build
env_prefix = build_and_pack_emscripten_env(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/jupyterlite_xeus_python/build.py", line 343, in build_and_pack_emscripten_env
raise e
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/jupyterlite_xeus_python/build.py", line 304, in build_and_pack_emscripten_env
pack_env(
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/empack/pack.py", line 143, in pack_env
included_files = filter_env(
^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/empack/filter_env.py", line 113, in filter_env
for pkg_meta in iterate_env_pkg_meta(env_prefix):
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/empack/filter_env.py", line 69, in iterate_env_pkg_meta
for pkg_meta in iterate_pip_pkg_record(env_prefix):
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/site-packages/empack/filter_env.py", line 20, in iterate_pip_pkg_record
relative_site_packages = site_packages.relative_to(env_prefix)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myusername/miniconda3/envs/jlite-tuto/lib/python3.11/pathlib.py", line 730, in relative_to
raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/private/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/site-packages' is not in the subpath of '/tmp/xeus-python-kernel/envs/xeus-python-kernel' OR one path is relative and the other is absolute.

Context

I am using macos monterey 12.6.7, Intel processor

uname -a
Darwin zoi 21.6.0 Darwin Kernel Version 21.6.0: Thu Jun  8 23:57:12 PDT 2023; root:xnu-8020.240.18.701.6~1/RELEASE_X86_64 x86_64

pathlib.Path().exists doesn't work correctly

For some reason, this fails with an error in xeus-python but works in pyodide/pyolite:

import os
import pathlib
os.path.exists("/drive/idontexist")
pathlib.Path("/drive/idontexist").exists()

In xeus-python it prints:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
/tmp/xpython_42/3913635030.py in <cell line: 4>()
      2 import pathlib
      3 os.path.exists("/drive/idontexist")
----> 4 pathlib.Path("/drive/idontexist").exists()

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/pathlib.py in exists(self)
   1286         """
   1287         try:
-> 1288             self.stat()
   1289         except OSError as e:
   1290             if not _ignore_error(e):

/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/pathlib.py in stat(self, follow_symlinks)
   1093         os.stat() does.
   1094         """
-> 1095         return self._accessor.stat(self, follow_symlinks=follow_symlinks)
   1096 
   1097     def owner(self):

OSError: [Errno 28] Invalid argument: '/drive/idontexist'

`FileNotFoundError` opening files with pandas that were previously visible

I've just started migrating to the xeus-python-kernel and I'm experiencing some unusual behaviour with opening local files using pandas.

I was opening files distributed with the JupyterLite as expected, but then updated the kernel on Github Pages, reloaded the JupyterLite environment, restarted kernels etc and tried to load the same files in from the same notebooks, but now the pandas file reads report as FileNotFoundError [Errno 44] No such file or directory.

The data files are visible in the file browser.

If I open and save the data files as is, they are still not found when I try to load them in.

I could clear the cache / local storage of all files and try a clean start, but the files saved to storage include many changes and would rather not have to export all the files and update the original repo with the changes, or import the files back in. (In part, I'm trying to shakedown the environment for student use and find issues and workarounds before things go live.)

Are there any tricks I could try / debug steps I could take to help identify any glitches?

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.