简体   繁体   中英

why does pip export with a different version on subsequent conda env exports?

I have been trying to establish a pre-commit git hook to detect environment changes and create a new env.yml export automatically... similar to the ones described here

Where I am having trouble is that the git hook is detecting an environment change with the pip package on every run of the pre-commit file. Is this possibly related to some scripts using different versions of pip?

If so, I don't understand why the same version isn't being exported every time I run conda env export > env.yml . It almost seems like it is randomly toggling between versions... but I know there must be some rationale

conda and pip have their own versions of every package installed (provided that you have installed a certain app using both). anaconda (if it's what you're using) is also known for giving plenty of headaches even in simple cases when you pip install something instead of conda install and start mixing dependencies installed with either of those. The general advice is to be very careful about being consistent with each environment separately . In my personal experience, anaconda always tries to superimpose itself by by breaking dependencies managed by pip . In short, if you are using a conda env, make sure that you're using the dependencies installed by conda and conda only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM