Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the package nbeats env #60

Open
AparnaSN opened this issue Feb 20, 2024 · 17 comments
Open

Error in the package nbeats env #60

AparnaSN opened this issue Feb 20, 2024 · 17 comments

Comments

@AparnaSN
Copy link

I am getting the error in the environment:

Error in purrr::map(., .f = function(df) { : ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function Error in purrr::map(): Error in purrr::map(): ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function

I have been using the package for a while. suddenly this error popping up. Please help

@mdancho84
Copy link
Contributor

It looks like pandas Timestamp() method is not being found.

What python packages are in your environment that modeltime GluonTS is using?

@AparnaSN
Copy link
Author

AparnaSN commented Feb 20, 2024 via email

@AparnaSN
Copy link
Author

Any workaround for this ? I am getting the same error above. I could able to install and load model time.gluonts, tidymodels,tidyverse and timetk . When I try to call nbeats function created it causing the issue

@mdancho84
Copy link
Contributor

Modeltime gluonts will internally load pandas as pd then it attempts to use the pd.Timestamp() function. So you need to make sure that pandas is installed in the modeltime gluonts python environment being used, and make sure this function exists.

@AparnaSN
Copy link
Author

I could see the pandas being installed in the environment. How do I make sure that the pd.Timestamp() function is loaded correctly

@AparnaSN
Copy link
Author

@mdancho84 I think the pandas is installed
All requested packages are showing as installed.

  • . /root/.local/share/r-miniconda/bin/activate
  • conda activate 'r-gluonts'
  • '/root/.local/share/r-miniconda/envs/r-gluonts/bin/python' -m pip install --upgrade --no-user 'mxnet~=1.7' 'gluonts==0.8.0' numpy 'pandas==1.0.5' 'pathlib==1.0.1' 'ujson==4.0.2' brotlipy

But I think it is not able to call the pkg.env$pd$Timestamp() function

@mdancho84
Copy link
Contributor

Which python environment is modeltime gluonts connected to?

@AparnaSN
Copy link
Author

AparnaSN commented Nov 20, 2024

The environment is : environment location: /root/.local/share/r-miniconda/envs/r-gluonts

Also, reticulate::py_discover_config() is returning:

python: /databricks/python3/bin/python
libpython: /usr/lib/python3.9/config-3.9-x86_64-linux-gnu/libpython3.9.so
pythonhome: /databricks/python3:/databricks/python3
virtualenv: /databricks/python3/bin/activate_this.py
version: 3.9.19 (main, Apr 6 2024, 17:57:55) [GCC 9.4.0]
numpy: /databricks/python3/lib/python3.9/site-packages/numpy
numpy_version: 1.21.5
numpy: /databricks/python3/lib/python3.9/site-packages/numpy

@AparnaSN
Copy link
Author

@mdancho84 I think when i start the new session, and when uses library(reticulate), it forces the python to reticulate environment but not the environment where r-gluonts is there. I tries to change the environment, but still it shows the reticulate environment. It was working before as expected. Any solution for this ?

@mdancho84
Copy link
Contributor

That could be the issue. In RStudio you can select in the project scope which Python environment to use for reticulate. I suggest you do this. See this article: https://support.posit.co/hc/en-us/articles/1500007929061-Using-Python-with-the-RStudio-IDE

@AparnaSN
Copy link
Author

AparnaSN commented Nov 21, 2024

@mdancho84 I am using Azure databricks not the R studio.

@mdancho84
Copy link
Contributor

You can programmatically force the python environment https://rstudio.github.io/reticulate/articles/versions.html

@AparnaSN
Copy link
Author

@mdancho84 I tried changing the environment but still the issue with timestamp is showing up. Error in purrr::map(., .f = function(df) { : ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function Error in purrr::map(): Error in purrr::map(): ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function

@AparnaSN
Copy link
Author

AparnaSN commented Nov 22, 2024

@mdancho84 Also tried to change the date column df$Date <- as.Date(df$Date) as_pandas_timestamp(df$Date)

Now the error message is different. Error in pkg.env$pd$Timestamp(number_date,…). attempt to apply non-function. Do I need to do some changes related to time zone? Is this anything related to day light savings since it was working before ?

@AparnaSN
Copy link
Author

@mdancho84 I am kind of stuck with this issue for more than a week. Any leads would help. There an no installation or environment issue . I think the issue is something related to the input date . But no format changes done for the input

@mdancho84
Copy link
Contributor

I apologize. I don't have time to fix it. ChatGPT is where I would go to troubleshoot.

@AparnaSN
Copy link
Author

@mdancho84 I think the issue is some thing related to the new gluonts 0.16.0 release that have some frequency changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants