-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
ENH Add support for reinstalling packages #64
base: main
Are you sure you want to change the base?
Conversation
Yes, there is a sprint in PyConUS so I tagged a few issues people have more to choose from. No worries if you took it :) |
Thanks @ryanking13!
I don't think this makes sense as a default. In my opinion it should not reinstall anything unless it is specifically requested. |
Maybe my description was not clear. It uninstalls only if the requested version is incompatible with the installed version. Previously in such cases, micropip failed with:
|
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.
I still think failing is better by default than reinstall. I think people really mostly don't want to reinstall packages that they've already imported but they might not realize they don't want to. Maybe having an allow reinstall flag would be good.
At the wasm summit they were asking if they could test packaging against wasm and I was like sure easy but then the command line runner had some weird crash...
Yeah, I'm also not sure about it. As a user, in the example above I would expect the If we take the case where we install some packages. Some are already installed with different versions. If the version is compatible we do nothing, if it isn't we uninstall them, and install the requested version (and leave all other packages unchanged). That's more or less what pip does (or used to do) by default. Can't we do that? |
Hmm, yes. Unlike other package managers micropip is a runtime package manager so the situation is more complex that some packages might be already imported... and we don't show any logs (unless verbose option is enabled in #60), so people will not even notice that some packages are reinstalled.
Yes, that is the current expected bahavior but I guess Hood does not prefer uninstalling packages without an explicit flag? |
Then how about:
|
Well if it's for matching pip then I could sort of see it. But the issue is just what happens if the package is already imported... |
Well jupyter shares the same problem and users would need to call |
Resolve #51
This PR changesmicropip.install
behavior to remove previously installed packages and reinstall the new version. In addition, it adds theforce_reinstall
parameter tomicropip.install
, allowing it to force a reinstall even if it already meets the requirements.Edit:
This PR adds
reinstall
parameter to micropip.install which allows reinstalling packages that are already installed.