首页 > 解决方案 > 使用 reticulate 在 R 中安装 python 包时出错

问题描述

我正在尝试访问 S&P Capital IQ 的 Python API 以提取数据以生成报告。但是,我完全不熟悉 Python 是如何工作的(之前只使用过 R),所以我希望就如何capiq_excel使用reticulate. 对于某些背景,我订阅了 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#概述

TIA

标签: pythonrreticulate

解决方案


第一次尝试

库(网状)py_install(“capiq_excel”)

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

install_miniconda("capiq_excel")


推荐阅读