-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
pyenv-build
calls conda install --yes pip
and updates conda
to a different version than desired
#2070
Comments
Left a comment upstream conda/conda#7959 (comment) |
Pip is installed because users typically expect it to be available. I'm not sure what we can do from our side other than re-align Pyenv's Anaconda entries and naming with their practices. What is Anaconda's autoupdate policy? Does it allow using old package versions (like vanilla CPython), or it enforces everyone to use the latest versions within some version envelope? Does it autoupdate Python, too -- if yes, to what extent? If e.g. it feels free to update anything as long as Python's |
Hi @humitos ! Unfortunately, we can't help you, because this is a bug of conda, not pyenv, as mentoined in comment, that you share:
|
IMO despite the unfortunate conda bug, pyenv could still look for a workaround. For example, something like |
I think there are two different problems here:
I still think that pyenv could do something to solve its own problem. One suggestion would be what @astrojuanlu said in the previous comment. Another possible solution would be just to not install Finally, pyenv could also add
While I tend to agree here, I'd say that this is more common on regular Python users, but I don't have the same feeling for conda users since packages are installed via Thank you all! |
I can confirm this solution works:
Note the This is the diff that I use to make this work: diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build
index a18680a4..ea976328 100755
--- a/plugins/python-build/bin/python-build
+++ b/plugins/python-build/bin/python-build
@@ -1042,7 +1042,9 @@ build_package_anaconda() {
build_package_miniconda() {
build_package_anaconda "$@"
- "${PREFIX_PATH}/bin/conda" install --yes "pip"
+ # Workaround to not upgrade conda when installing pip
+ # see https://github.com/pyenv/pyenv/issues/2070
+ "${PREFIX_PATH}/bin/conda" install --yes "pip" "conda=$(${PREFIX_PATH}/bin/conda --version | cut -d ' ' -f 2)"
}
build_package_copy() { Click to see full output
|
We can do this... but won't this just postpone the inevitable? Whenver you run The real solution -- if we're not going to change the conda packaging scheme -- seems to be to configure Anaconda to not autoupdate itself: https://stackoverflow.com/questions/48726621/is-it-possible-to-lock-versions-of-packages-in-anaconda
|
Maybe. However, there are two benefits still:
Setting conda to not auto update itself makes sense to me. That's basically what the user wants when calling |
So, the autoupdate shouldn't be disabled in the |
@anton-petrov This looks like not a bug but an intentional feature to me, especially in the light of the aforementioned dedicated setting to control it. Whatever we think of this feature, we need to decide what to do about it. |
@native-api I think we can use a temporary workaround for this from #2070 (comment)
Just created a PR #2074 |
When installing miniconda3, `pyenv-build` calls: conda install --yes pip which automatically updates conda to its latest version and making us lossing our pinned version. This commit adds a patch to keep installing pip after conda install, but pinning conda to the current version to avoid upgrading it automatically. See pyenv/pyenv#2070
I've implemented the @humitos See the CAUTION note there -- it turns out, it's still not bulletproof. |
Hi all! Thanks for this amazing project.
I found a problem with
conda
version not being the desired one. This happens because afterconda
is installedpyenv-build
callsconda install --yes pip
at this line https://github.com/pyenv/pyenv/blob/v2.0.6/plugins/python-build/bin/python-build#L1037 which makes conda to updates all the packages installed in the base system:Note that
conda-4.7.12
was updated toconda-4.10.3
but that's not version that I toldpyenv-build
to install.I'd suggest to not install
pip
(whypip
is installed by default?) or find a way to tell conda to not update other dependencies (I tried passing--no-update-deps
but it didn't work as expected).Let me know if I can be useful here.
Click to see the full output
The text was updated successfully, but these errors were encountered: