how to build a package locally so that conda will not to try to replace it with anaconda one? #3324
Labels
locked
[bot] locked due to inactivity
stale::closed
[bot] closed after being marked as stale
stale
[bot] marked as stale due to inactivity
tl;dr - how to tell conda/conda-build to not upgrade/downgrade a given package if the version+arch match the package on anaconda, letting the user assume responsibility over potential issues. or perhaps being able to tell conda not to upgrade/downgrade certain pip-installed packages as long as the versions match.
Here is the full question/request:
Here is a complex situation.
You may know that
Pillow
has aPillow-SIMD
fork that does some image processing much faster. The culprit is that it has to be built from source by each user to her specific cpu specification. I.e. there is no way to pre-build binary versions since there are hundreds of different CPUs and the package managers don't support this anyway.The problem is that if I build
Pillow-SIMD
as a pip package namedPillow
locally and install it, while pip will not try to overwrite it, conda will overwrite it on any conda package install/update that requiresPillow
. So one needs to watch every conda install/update and rebuildPillow-SIMD
all the time. And it's complicated, since rebuilding it requires removingjpeg
,libtiff
, installinglibjpeg-turbo
, building/installingPillow-SIMD
and then reinstallinglibtiff
.I next tried to build
Pillow-SIMD
as a local condaPillow
package and install it. But no matter what I do conda still tries to either downgrade or upgrade the locally built/installedPillow
to the anaconda' binary of the same.The version and arch are identical, but some files are different - since it's a faster replacement for
Pillow
.I understand why this is happening - to ensure that the whole system is consistent and all dependencies are exact.
There needs to be a way for a user to tell conda that she chooses to use this version of a package, accepting the responsibility for any problems. So if I installed my own version of
Pillow==5.3.0
, I don't want conda to replace it with a pre-made version on anaconda, no matter what. So that if there is package XYZ that relies on anaconda'sPillow==5.3.0
, and I install it and it breaks it's my responsibility. We already have--force
so it's not like users can't shoot themselves in a foot.I'm not sure whether this better belongs to the builder or the installer, so perhaps one of the two:
Actually, an even easier solution, would be to be able to tell conda not to upgrade/downgrade certain packages installed by pip, as long as versions match. So it'd be sort of a --force extension.
So just like pip respects conda packages and doesn't overwrite them if the versions match, a user will have a way to tell conda to respect certain pip packages and do the same. I think I like that idea the best. I have no idea, of course, how complex that would be to implement.
I hope my explanations and the need make sense.
For those who are curious there is a detailed attempt at solving this problem here, including code:
uploadcare/pillow-simd#44 (comment)
Thank you.
edit: this seems to help a lot:
but more testing is needed.
The text was updated successfully, but these errors were encountered: