【问题标题】:Error when installing python package in R using reticulate使用 reticulate 在 R 中安装 python 包时出错
【发布时间】:2020-11-12 08:41:18
【问题描述】:

我正在尝试访问 S&P Capital IQ 的 Python API 以提取数据以生成报告。但是,我完全不熟悉 Python 的工作原理(之前只使用过 R),所以我希望就如何使用 reticulate 在 R 中安装 capiq_excel 包获得一些帮助。对于某些背景,我订阅了 S&P Capital IQ,并且在我的计算机上加载了 excel 插件,这显然是让它工作的依赖项。

当我尝试使用以下代码在 R 中安装包时

library(reticulate)
py_install(capiq_excel)

我收到以下错误

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - capiq_excel

Current channels:

  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/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.


Error: one or more Python packages failed to install [error code 1]

我的做法完全错误吗?安装包后,我想使用 API 在 R 中创建数据帧。capiq_excel 包的文档可以在这里找到 (https://nickderobertis.github.io/capiq-excel-downloader-py/tutorial.html#overview)

TIA

【问题讨论】:

    标签: python r reticulate


    【解决方案1】:

    第一次尝试

    图书馆(网状) py_install("capiq_excel")

    如果上面的代码不起作用,试试这个

    install_miniconda("capiq_excel")

    【讨论】:

    • 我认为这不是最好的方法,因为reticulate::install_miniconda() 仅用于安装 conda 环境而不是包本身。您使用此代码所做的是创建一个名为 capiq_excel 的文件夹,其中 conda 安装在其中。
    猜你喜欢
    • 2022-01-13
    • 1970-01-01
    • 1970-01-01
    • 2018-07-01
    • 2019-02-28
    • 2018-08-31
    • 1970-01-01
    相关资源
    最近更新 更多