Combining conda environment.yml with pip requirements.txt(将 conda environment.yml 与 pip requirements.txt 相结合)
问题描述
我使用 conda 环境,也需要一些 pip 包,例如来自 ~gohlke 的预编译轮子.
I work with conda environments and need some pip packages as well, e.g. pre-compiled wheels from ~gohlke.
目前我有两个文件: environment.yml
for conda with:
At the moment I have two files: environment.yml
for conda with:
# run: conda env create --file environment.yml
name: test-env
dependencies:
- python>=3.5
- anaconda
和requirements.txt
为pip,激活上述conda环境后即可使用:
and requirements.txt
for pip which can be used after activating above conda environment:
# run: pip install -i requirements.txt
docx
gooey
http://www.lfd.uci.edu/~gohlke/pythonlibs/bofhrmxk/opencv_python-3.1.0-cp35-none-win_amd64.whl
是否有可能将它们合并到一个文件中(对于 conda)?
Is there a possibility to combine them in one file (for conda)?
推荐答案
Pip 依赖可以像这样包含在 environment.yml
文件中(docs):
Pip dependencies can be included in the environment.yml
file like this (docs):
# run: conda env create --file environment.yml
name: test-env
dependencies:
- python>=3.5
- anaconda
- pip
- numpy=1.13.3 # pin version for conda
- pip:
# works for regular pip packages
- docx
- gooey
- matplotlib==2.0.0 # pin version for pip
# and for wheels
- http://www.lfd.uci.edu/~gohlke/pythonlibs/bofhrmxk/opencv_python-3.1.0-cp35-none-win_amd64.whl
它也适用于同一目录中的 .whl
文件(请参阅 Dengar 的答案)以及常见的 pip 包.
It also works for .whl
files in the same directory (see Dengar's answer) as well as with common pip packages.
这篇关于将 conda environment.yml 与 pip requirements.txt 相结合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 conda environment.yml 与 pip requirements.txt 相结合


- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- python-m http.server 443--使用SSL? 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 沿轴计算直方图 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01