简体   繁体   English

为什么 pip 在后续的 conda env 导出中导出不同的版本?

[英]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). condapip安装了每个 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,请确保您使用的是condaconda仅安装的依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么 `conda env export` 没有列出所有 pip 包? - Why doesn't `conda env export` list all pip packages? conda env中的错误点子 - Wrong pip in conda env 为什么 pip 不允许我在新的 conda env 中安装 torch==1.9.1+cu111 当我有另一个具有该版本的 conda env 时? - Why is pip not letting me install torch==1.9.1+cu111 in a new conda env when I have another conda env that has exactly that version? 为什么每次使用 conda 创建 env 时默认 python 版本都会更改? - Why does default python version change every time I create env with conda? 为什么conda安装pip / setuptools等…? - Why does conda install pip/setuptools etc…? conda env export --from-history 不跟踪频道 - conda env export --from-history does not track channels 为什么pip在travis中安装不同的软件包版本? - Why does pip install a different package version within travis? 为什么pip会根据python版本升级到不同版本? - Why does pip upgrade to different versions depending on python version? conda和pip在不同的路径 - Conda and pip are in different paths 适用于anaconda环境的错误点子版本。 使用“ conda activate”激活环境时,我该怎么做才能更正点子版本? - Wrong pip version for anaconda's environments. What should I do to correct the pip version when activate a env using `conda activate`?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM