modeltime.gluonts icon indicating copy to clipboard operation
modeltime.gluonts copied to clipboard

Error occurs calling `install_gluonts()` on arm64 Mac M1

Open chenx2018 opened this issue 3 years ago • 7 comments

Error occurs calling install_gluonts() on arm64 Mac M1.

It seems like there are some pacakges are not available in 3.7 Python channel. The error code is the following:

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

  - python=3.7.1

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/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: Error creating conda environment 'r-gluonts' [exit code 1]

Using the develope version of reticulate pacakge to install miniconda, the Python version is 3.8.12.

Here is my python information calling reticulate::py_discover_config()

python:         /Users/username/Library/r-miniconda-arm64/envs/r-reticulate/bin/python
libpython:      /Users/username/Library/r-miniconda-arm64/envs/r-reticulate/lib/libpython3.8.dylib
pythonhome:     /Users/username/Library/r-miniconda-arm64/envs/r-reticulate:/Users/username/Library/r-miniconda-arm64/envs/r-reticulate
version:        3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:25:50)  [Clang 11.1.0 ]
numpy:          /Users/username/Library/r-miniconda-arm64/envs/r-reticulate/lib/python3.8/site-packages/numpy
numpy_version:  1.22.0

Any suggestions? Thanks!

chenx2018 avatar Jan 11 '22 09:01 chenx2018

I'd try following the Installation Guide here, which has troubleshooting guidance for the Python Environment and details on how to set up custom environments.

As of this message, the major requirements are:

  • gluonts>=0.8.0 (required for modeltime.gluonts >= 0.3.0). Note that I test with gluonts==0.8.0, so I recommend that version.
  • mxnet~=1.7
  • pandas
  • numpy
  • pathlib
  • ujson

mdancho84 avatar Jan 11 '22 11:01 mdancho84

I tried the above approach by calling:

reticulate::py_install(
    envname  = "my_gluonts_env",
    python_version = "3.8.12",
    packages = c(
        "mxnet~=1.7",
        "gluonts==0.8.0",
        "pandas==1.0.5",
        "numpy",
        "pathlib==1.0.1",
        "ujson==4.0.2"
    ),
    method = "conda",
    pip = TRUE
)

and the error is:

ERROR: Could not find a version that satisfies the requirement mxnet~=1.7 (from versions: 1.6.0)
ERROR: No matching distribution found for mxnet~=1.7
Error: Error installing package(s): "'mxnet~=1.7'", "'gluonts==0.8.0'", "'pandas==1.0.5'", "'numpy'", "'pathlib==1.0.1'", "'ujson==4.0.2'"

chenx2018 avatar Jan 11 '22 11:01 chenx2018

MXNet is up to 1.9.0 on pypi so pip should be able to install it. Maybe try changing to 1.9.0.

mdancho84 avatar Jan 11 '22 12:01 mdancho84

I think the only available version of mxnet is 1.6.0 as the error message shows:

ERROR: Could not find a version that satisfies the requirement mxnet~=1.9.0 (from versions: 1.6.0)
ERROR: No matching distribution found for mxnet~=1.9.0
Error: Error installing package(s): "'mxnet~=1.9.0'", "'gluonts==0.8.0'", "'pandas==1.0.5'", "'numpy'", "'pathlib==1.0.1'", "'ujson==4.0.2'"

chenx2018 avatar Jan 12 '22 01:01 chenx2018

same here. Any news?

I think the only available version of mxnet is 1.6.0 as the error message shows:

ERROR: Could not find a version that satisfies the requirement mxnet~=1.9.0 (from versions: 1.6.0)
ERROR: No matching distribution found for mxnet~=1.9.0
Error: Error installing package(s): "'mxnet~=1.9.0'", "'gluonts==0.8.0'", "'pandas==1.0.5'", "'numpy'", "'pathlib==1.0.1'", "'ujson==4.0.2'"

TT4T avatar Mar 24 '22 12:03 TT4T

Are you using M1? I believe that is the problem.

mdancho84 avatar Mar 24 '22 12:03 mdancho84

I got it to work by using the older R & Rstudio that isn’t optimized for M1. Thus using Rosetta. @mdancho84

frostbite345 avatar Mar 30 '22 11:03 frostbite345