简体   繁体   English

在使用Anaconda依赖项时如何安装PyPI软件包?

[英]How can I install a PyPI package while using Anaconda dependencies?

When I install a package through pip (since it was not available on Anaconda), it also pulls all dependencies. 当我通过pip安装软件包时(由于Anaconda上不可用),它还会提取所有依赖项。 It seems it will use the pip versions of the dependencies, even if conda versions (same name) are available. 即使conda版本(名称相同)可用,它似乎也会使用依赖项的pip版本。

How can I easily install a pip package, but use conda for the dependencies where such a package exists? 我如何轻松安装pip软件包,但将conda用于此类软件包所在的依赖项?

There is no easy way, I suspect. 我怀疑没有简单的方法。 Create a virtual environment, install all anticipated dependencies using conda and then install the main package using pip without -U/--upgrade . 创建一个虚拟环境,使用conda安装所有预期的依赖项,然后使用不带-U/--upgrade pip安装主软件包。 pip seeing dependencies installed will not install them again. pip看到安装的依赖项将不会再次安装它们。

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

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