-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Micropip should be able to process requirements files #6
Comments
We should probably nudge users toward using some form of a lock file instead of a requirement.txt file, but I suppose it still makes sense to support requirements.txt files for existing projects. |
BTW, tried recently pip-tools for lock file generation in a |
Any ideas/examples how this could be accomplished on the caller side today e.g. by feeding packages one by one?
|
@miohtama Can you open a new issue with the details of the errors you are getting?
micropip has fairly rudimentary dependency resolution where it starts from the first package, loads recursively all requirements, and hopes that all will be OK. You can see what it is doing in the dev console log.
Well, you can do something like, from pathlib import Path
requirements = Path('requrements.txt').read_text().splitlines()
await micoropip.install(requirements) the question is how to create that frozen list of requirements. What poetry or pip-compile will give you will not be correct, since it will not take into account binary wheels that exist for the emscripten/wasm platform. We are exploring this topic in pyodide/pyodide-lock#10 but it's still early days. Meanwhile, you can also take the output of frozen requirements given to you by those tools and manually tweak it until it works. In particular, any package version with binary wheels (e.g. numpy etc) need to match the version in the Pyodide distribution otherwise it will not be able to find the wheel. Though it's certainly not a very user friendly approach. |
🚀 Feature
We should have a micropip version of
pip install -r requirements.txt
. Maybemicropip.install(requirements_file="some/path")
.The text was updated successfully, but these errors were encountered: