Open psychemedia opened 1 year ago
It's not available (yet?). I guess it could be done for pure Python packages, but for now you'll need to rely on conda-forge and emscripten-forge packages.
It's not yet working but we working on integrating micropip and a very slim mamba (picomamba) into xeus-python.
I guess the original question was concerning pre-installed packages?
Is there any way for a user to installing additional packages from pip into a running
xeus-python
kernel?
but his question is about installing in a "running" kernel, ie not pre-install?
Original comment was more along the lines of: I am in a notebook running a xeus-python
kernel; how do I do an equivalent of %pip install newPackage
.
Elsewhere, I learned that the default pyodide kernel now supports %pip
magic.
Elsewhere, I learned that the default pyodide kernel now supports
%pip
magic.
Yes this was added in 0.1.0b14
: https://jupyterlite.readthedocs.io/en/latest/changelog.html#b14
For reference micropip
should now be available on conda-forge: https://github.com/conda-forge/micropip-feedstock
It would be interesting to get it to install packages on the fly in the xeus python kernel.
It would be interesting to get it to install packages on the fly in the xeus python kernel.
Gave this a try with the following environment.yml
:
name: test
channels:
- https://repo.mamba.pm/emscripten-forge
- https://repo.mamba.pm/conda-forge
dependencies:
- micropip
Importing micropip
works:
import micropip
micropip.__version__
# '0.3.0'
Installing a package with:
micropip.install('emoji')
Then importing it with:
import emoji
Gives the following:
Any updates on the ability to install packages at runtime?
(To a certain extent, NOT supporting this might be useful in an educational context, if you want students to be limited to using just and only what is provided...)
Having micropip
available might be handy when working out what's required when putting toigether a new environment, though...
(To a certain extent, NOT supporting this might be useful in an educational context, if you want students to be limited to using just and only what is provided...)
Probably this would be the case depending on whether the micropip
(or equivalent) package is available in the kernel environment, which would be controlled by the site deployer.
The coming update to the new emscripten-wasm32 platform may allow using micropip? @DerThorsten
Thinking about the environment.yaml
config file, the "normal" config file spec allows you to install pip
as a dependency and then provide a sublist of pip
packages to install from PyPI. Is there any sense in which you can installpip
or micropip
packages as part of the xeus-python-kernel
's environment.yaml
file?
As of recently xeus-python allows partial support for installing pip dependencies: https://xeus-python-kernel.readthedocs.io/en/latest/configuration.html#pip-packages
Though you should not specify pip
in the dependency list. We should probably take care of this case though. I'll open an issue for that.
Is there any way for a user to installing additional packages from pip into a running
xeus-python
kernel?