question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configure Pyolite to have packages automatically installed

See original GitHub issue

Problem

It is currently not possible to automatically install Python packages inside the pyolite kernel.

Proposed Solution

It would be nice to be able to configure Pyolite to include some packages that would automatically be installed with micropip.

cc. @psychemedia who suggested it here https://github.com/jtpio/jupyterlite-demo/pull/7#issuecomment-870144941

Additional context

It might be possible to have it once we use IPython for the execution (see related work https://github.com/jtpio/jupyterlite/pull/171), as it’s possible to configure IPython itself to run code at the shell start.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:31 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
bollwyvlcommented, Jun 29, 2021

I feel we need to figure out some way to get these hosted with the build, get the service worker going, use dat/ipfs, etc. before installing more stuff magically. Spamming pypi with requests without any kind of caching isn’t very nice… They probably weren’t signing up to be a static cdn for web page assets.

1reaction
jtpiocommented, Jul 15, 2021

@RandomFractals for some libraries it’s a bit trickier as they require patches to be rendered properly in output cells in JupyterLite.

Have you considered optimizing your kernel initialization with just the basics without adding all the other dataviz packages most devs and data scientists might not be using in their pyodide notebooks.

Yes, see #239 as an example. Unfortunately there were some issues with the recursion limit in upstream Pyodide, so the change had to be reverted. But hopefully will come back at some point: #254

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to automatically install required packages in ...
You have to keep your requirements in requirements.txt in you project folder as like package.json in nodejs . eg: pip install package1 pip ......
Read more >
Use additional Python packages - JupyterLite - Read the Docs
New packages can be downloaded and installed at runtime. ... Once you have added the new package(s) and rebuilt Pyodide, you can configure...
Read more >
How to Install Python Packages using a Script - ActiveState
Click to create a Python script to install packages.
Read more >
Installing Python Packages from a Jupyter Notebook
I installed package X and now I can't import it in the notebook. ... If you already have a Python installation that you're...
Read more >
Installing Packages - Python Packaging User Guide - Python.org
It does not to refer to the kind of package that you import in your Python source ... If you do not have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found