I can't install gekko package via R reticulate. My R version is 3.4.4 and my Python version is 3.8.8 and I use Gekko in Python without problems. So I tried to install on R in these two ways I know:
py_install("gekko")
reticulate::conda_install("my_conda_environment", "gekko")
However in both cases I receive the same error bellow.
PackagesNotFoundError: The following packages are not available from current channels:
- gekko
Current channels:
- https://conda.anaconda.org/root/win-64
- https://conda.anaconda.org/root/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
I didn't find other alternatives in the Anaconda documentation. How can I fix this?
Edit: I solved my problem based on the references in John Hedengren's answer and reticulate docs. For that, I needed to create a new environment to specify the Python version and packages using the following code in R:
reticulate::py_install(
packages = c(
"numpy",
"pandas", # Or another packages that you need
"gekko"
),
envname = "r-gekko",
method = "conda", # On Windows, the 'conda' method is always used
python_version = "3.8.8",
pip = TRUE # It's mandatory to install gekko
)