business-science / modeltime.gluonts

GluonTS Deep Learning with Modeltime
https://business-science.github.io/modeltime.gluonts/
Other
38 stars 11 forks source link

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

Open chenx2018 opened 2 years ago

chenx2018 commented 2 years ago

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!

mdancho84 commented 2 years ago

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:

chenx2018 commented 2 years ago

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'"
mdancho84 commented 2 years ago

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

chenx2018 commented 2 years ago

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 commented 2 years ago

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'"
mdancho84 commented 2 years ago

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

frostbite345 commented 2 years ago

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