Search code examples
pythonrreticulate

Error when installing python package in R using reticulate


I am trying to access S&P Capital IQ's Python API to pull data for a report. However, I'm completely unfamiliar with how Python works (only used R before), so I'm hoping to get some help on how I can install the capiq_excel package in R using reticulate. For some background, I have an S&P Capital IQ subscription and I have the excel plugin loaded on my computer, which would obviously be a dependancy to get this to work.

When I try to install the package in R using the following code

library(reticulate)
py_install(capiq_excel)

I get the following error

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]

Am I approaching this completely wrong? After installing the package, I would like to use the API to create dataframes in R. The documentation for the capiq_excel package can be found here (https://nickderobertis.github.io/capiq-excel-downloader-py/tutorial.html#overview)

TIA


Solution

  • First try

    library(reticulate) py_install("capiq_excel")

    If the code above does not work try this

    install_miniconda("capiq_excel")