【问题标题】:treelite cannot be intsalled within conda with piptreelite 不能用 pip 安装在 conda 中
【发布时间】:2019-05-10 07:47:17
【问题描述】:

我有以下 .yml 文件:

name: data_science_env_prob3
channels:
  - defaults
dependencies:
  - openssl=1.1.1
  - pandas=0.23.4=py37h6440ff4_0
  - scikit-learn=0.19.2=py37h4f467ca_0
  - pip:
    - treelite==0.32
    - urllib3==1.24.1
    - xgboost==0.71

当我尝试创建环境时

conda env create -f data_science_env.yml

,它会抛出一个错误:

Could not find a version that satisfies the requirement treelite==0.32 (from -r /path/condaenv.ijla7f1z.requirements.txt (line 17)) (from versions: )
No matching distribution found for treelite==0.32 (from -r /path/condaenv.ijla7f1z.requirements.txt (line 17))

但是,我可以使用

安装 treelite(不在 conda env 中)
pip install treelite

如何使用 conda .yml 文件安装 treelite?

编辑: 我创建了一个没有 treelite 的环境,然后能够通过以下方式安装 treelite:

pip3 install --user treelite

但是跟随它失败了:

 pip install --user treelite
Collecting treelite
  Could not find a version that satisfies the requirement treelite (from versions: )
No matching distribution found for treelite

【问题讨论】:

  • 我尝试使用 python 3.7 从 conda 环境安装 treelite,但 pip 找不到它。也许你应该使用 python 3.6,因为很多包还不支持 3.7。
  • 你真的应该检查which pipwhich pip3。可能前者正在使用 env 的 pip,而后者正在解析回您系统的 pip(即使 env 处于活动状态),因此仍未安装在 env 中。

标签: python conda


【解决方案1】:

Treelite 目前无法通过 pip 获得 Python 3.7。

您需要从源代码安装或切换到 Python 3.7 环境。

【讨论】:

    猜你喜欢
    • 2020-04-06
    • 1970-01-01
    • 2018-01-10
    • 1970-01-01
    • 2021-12-16
    • 2021-02-08
    • 2019-01-13
    • 1970-01-01
    • 2022-08-03
    相关资源
    最近更新 更多