[英]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我一直在尝试建立一个预提交 git 挂钩来检测环境变化并自动创建一个新的 env.yml 导出...类似于此处描述的那些
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.我遇到问题的地方是 git 挂钩在每次运行预提交文件时都检测到 pip package 的环境变化。 Is this possibly related to some scripts using different versions of pip?
这可能与使用不同版本 pip 的某些脚本有关吗?
If so, I don't understand why the same version isn't being exported every time I run conda env export > env.yml
.如果是这样,我不明白为什么每次运行
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). conda
和pip
安装了每个 package 的自己的版本(前提是您已经安装了使用这两者的某个应用程序)。 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. anaconda
(如果它是您正在使用的)也因为即使在简单的情况下也会带来很多麻烦,当您pip install
某些东西而不是 conda conda install
并开始混合使用其中任何一个安装的依赖项时。 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
.根据我的个人经验,
anaconda
总是试图通过打破pip
管理的依赖关系来叠加自己。 In short, if you are using a conda
env, make sure that you're using the dependencies installed by conda
and conda
only.简而言之,如果您使用的是
conda
env,请确保您使用的是conda
和conda
仅安装的依赖项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.