python - Conda 拒绝安装 requirements.txt 中的软件包只是因为一些异常值,如何解决?
问题描述
我正在使用 requirements.txt 来管理我的 python 依赖项:
six
tqdm
future
numpy
brine
scipy
matplotlib
# birdseye
shapely
git+https://github.com/tribbloid/jupyerlab-desktop.git#subdirectory=python
jupytext
# pyre-check
# deprecated
torch >= 1.2.0
# tensorboard
# opencv >= 4.0.0
# prototypes
git+https://github.com/pytorch/vision.git@v0.4.0#egg=torchvision
tb-nightly
我的环境是 python 3.7 上的 conda env。我试图使用一些命令来安装这些软件包,但是当我运行时:
conda install --file requirements.txt
我收到以下错误消息:
$ conda install --file ./requirements.txt
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- tb-nightly
- //github.com/tribbloid/jupyerlab-desktop.git
- torch[version='>=1.2.0']
- //github.com/pytorch/vision.git@v0.4.0
- brine
Current channels:
- https://conda.anaconda.org/conda-forge/linux-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
似乎 conda 拒绝安装它们中的任何一个只是因为它找不到 3 个软件包!(他们在 PyPI 上)这个设计有什么意义,我应该怎么做才能修复它?
我的最终目标是尽可能使用 conda,如果它们仅在 PyPI 上,则回退到 pip,整个过程应该是可重复的和完全自动化的。
解决方案
您可以从中删除有问题的软件包requirements.txt
,在新的 上运行 conda .txt
,然后将未安装的软件包安装pip
到您的Anaconda/pkgs
(或在安装后手动将它们移到那里)。然后,运行conda update --all
以确保兼容性。
在类似的情况下为我工作。
推荐阅读
- php - Laravel Socialite 410 Gone 此资源在 v1 API 下不再可用
- angular - prod 部署后,Angular 8 无法直接转到延迟加载的模块
- mongodb - 我应该如何处理 Vue.js 和每个在 MongoDB 中拥有一个集合的用户的身份验证?
- c# - 泛型类型值和“默认”关键字的“==”运算符的行为是什么?
- php - 在 php 中创建不可继承的类方法
- html - 如何从excel表中的链接列表中提取网站中的表格?
- python - 使用 df.to_sql 插入带撇号的姓氏
- ios - 查看 Xcode 中的 TestFlight 崩溃日志
- python-3.x - 使用 Python 3 在计算机上搜索 .mp3
- node.js - 平均堆栈的平方支付