-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: package installation from pypi #961
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This reverts commit 251d8df.
... | ||
|
||
@abc.abstractmethod | ||
async def install(self, package: str) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth installing multiple at once? its more performant and possibly more correct because the package manager can find the right versions compatible across all the packages requested to be installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly more correct because the package manager can find the right versions compatible across all the packages requested to be installed
Good point regarding correctness. Unfortunately we may lose the progress notifications in the UI, though, if we install multiple at once.
|
||
|
||
@router.post("/install_missing_packages") | ||
@requires("edit") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do this on read
too when in pyodide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a TODO
This PR adds a basic UI to install packages using pip from the frontend. When packages are detected as missing (we use a
ModuleNotFoundError
as a heuristic), a list of missing packages is presented to the user, along with an option to install them using pip.This is mostly for convenience -- it can be helpful when you spin up a new environment for prototyping or for testing a notebook someone shared with you, by eliminating the need to quit a marimo notebook, install the missing packages, and restart it.
If the user chooses to install, the UI starts installing the packages one by one, showing which package is currently being installed, which failed to install, and which succeeded. Installation of a package triggers re-running of the cell that imports it
Some notes:
Room for improvement: