Issue
i have installed tensorflow (the last version), and it works perfectly. after a while, i wanted to install scikit-learn (with conda in the same environment), however tensorflow stopped working. the problem is that some packages are updated, which are inconsistent with the current version of tensorflow (for instance) :
numpy 1.23.5 -> is updated to numpy-1.24.3 (and tensor-flow have problems with this version)
charset-normalizer is also changed to charset-normalizer-2.0.4 (which also causes issues)
there are other packages that are also updated and some of them still downloading the same version like certifi-2023.5.7!
questions:
- Shouldn't conda automatically prevent this? because the documentation for install says: "installs a set of packages consistent with those specifications and compatible with the underlying environment. If full compatibility cannot be assured, an error is reported and the environment is not changed"... Answer: it maybe due to the fact that tensor-flow is installed with pip not conda
- Why some already existing packages with similar version numbers are also downloaded again?
- And finally the most import one: how can I prevent this? how cant i force conda not to change the already existing packages and find the version of scikit-learn compatible with the current environment.
the documentation for install says "To prevent existing packages from updating, use the --freeze-installed option." however, it doesn't work and already existing packages still change.
I have already (in another machine) installed scikit-learn (with pip) and then tensor-flow and they both worked fine.
Also when i am using anaconda as channel parameter (i.e. conda install -c anaconda scikit-learn) the installation seems to have no problem and both packages work fine (though the installed scikit-learn isn't the latest version). However, i am looking for a general solution for such problems.
Solution
Conda does not use Pip-installed packages when considering how to satisfy Conda specifications. So, very possible it might change Pip-installed packages despite a --freeze-installed
directive.
Regarding changes within versions: those are very likely different builds and get generated whenever new versions of shared libraries they need change versions. The builds should change in such a way to make all those depending on the shared library are linked against a common version.
As for an actual solution, Conda has long recommended a very specific workflow for mixing Conda and Pip. This involves always working from a YAML definition and recreating the environment every time you mutate your specifications, whether Conda or Pip. Otherwise, the problems being described are par for the course when choosing not to adhere to these recommendations.
Lastly, it may be worth mentioning the pip_interop_enabled
option. However, this is experimental, and it definitely has caveats.
Answered By - merv
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.