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

[prophet] prophet installation fails with ModuleNotFoundError: No module named 'lunarcalendar' #20901

Closed
3 tasks done
mdeshmu opened this issue Jul 28, 2022 · 14 comments
Closed
3 tasks done
Labels
#bug Bug report

Comments

@mdeshmu
Copy link
Contributor

mdeshmu commented Jul 28, 2022

How to reproduce the bug

Following methods to install prophet on docker image of Superset 1.5.1 fails with ModuleNotFoundError: No module named 'lunarcalendar'

docker pull apache/superset:1.5.1
docker run -it <imageid> bash
pip install apache-superset[prophet]
pip install --no-cache-dir apache-superset[prophet]
pip install prophet==1.0.1
pip install --no-cache-dir prophet==1.0.1

Note that the missing dependency can be anything, depending of what it is already installed or not, I personally saw errors about missing lunarcalendar, pystan, tqdm. Same has been explained here

For me, this worked finally: pip install lunarcalendar tqdm "pystan<3.0" && pip install "prophet>=1.0.1, <1.1" but i think even this might break in future if version of any of the other common dependencies with superset are changed or dependency is removed altogether.

Note: prophet dependency issues were solved recently in 1.1 release.
I can install latest 1.1 prophet package with pip install prophet without errors but holidays package gets upgraded and then superset db upgrade breaks and gives below error.
pkg_resources.ContextualVersionConflict: (holidays 0.14.2 (/usr/local/lib/python3.8/site-packages), Requirement.parse('holidays==0.10.3'), {'apache-superset'})
pkg_resources.DistributionNotFound: The 'holidays==0.10.3' distribution was not found and is required by apache-superset

Can holidays package dependency be bumped to 0.14.2 in Superset ?

Expected results

It should be easy to install prophet

Actual results

its really messy

Screenshots

Here are the logs:

prophet-latest-directly.txt
prophet-via-setup-py.txt
prophet-1.0.1-directly.txt

Environment

  • browser type and version: NA
  • superset version: 1.5.1
  • python version: 3.8.13
  • node.js version: NA
  • any feature flags active: NA

Checklist

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

@mdeshmu mdeshmu added the #bug Bug report label Jul 28, 2022
@wiktor2200
Copy link
Contributor

I have the same issue, but I was unable to fix it with pip install lunarcalendar tqdm "pystan<3.0" && pip install "prophet>=1.0.1, <1.1". Have you changed something else?

@mdeshmu
Copy link
Contributor Author

mdeshmu commented Aug 1, 2022

This is what i have exactly in my Dockerfile.

RUN pip install --upgrade pip
RUN pip install lunarcalendar tqdm "pystan<3.0" && pip install "prophet>=1.0.1, <1.1"

@haydarmiezanie
Copy link

haydarmiezanie commented Aug 4, 2022

I have some problem, I can't use prophet. I'm using 2.0 superset

@mdeshmu
Copy link
Contributor Author

mdeshmu commented Aug 4, 2022

@villebro @zhaoyongjie @etr2460 As more people are reporting this issue, request you to provide your opinion for a permanent solution.

@EliottTardieu
Copy link

Hello, I used the command @mdeshmu suggested to use, but it's still not working. Whenever I toggle forecast, it says "No results were returned for this query". Any idea ? (Not using Superset 2.0 btw)

@wiktor2200
Copy link
Contributor

With this Dockerfile:

FROM apache/superset:2.0.0 AS superset
USER root

RUN rm -rf /var/lib/apt/lists/* && \
    pip install \
        Authlib==1.0.1 \
        flask-oidc==1.3.0 \
        psycopg2-binary==2.9.1 \
        redis==3.5.3

## Install prophet and dependencies - there is open issue on Github: https://github.com/apache/superset/issues/20901
RUN pip install \
        lunarcalendar==0.0.9 \
        tqdm==4.64.0 \
        pystan==2.19.1.1   
RUN pip install prophet==1.0.1

USER superset

I was able to build Superset with prophet, but it still doesn't work. I'm having the same problem as above, no more errors, but forecast always returns 0 rows.
I've tried with both 2.0.0 and 1.5.1.

@mdeshmu
Copy link
Contributor Author

mdeshmu commented Aug 4, 2022

@wiktor2200 @EliottTardieu Can you confirm you don't have multiple App containers running and prophet is installed on the container you are browsing for. You may check using pip freeze.

@wiktor2200
Copy link
Contributor

I'm using Dockerfile from above and when I exec into container/pod, prophet is there, but returning 0 rows in every query when Enable Forecast is turned on.

pip freeze result (prophet is installed in version 1.0.1)

[...]
progress==1.6
prompt-toolkit==3.0.28
prophet==1.0.1
psycopg2-binary==2.9.1
ptyprocess==0.7.0
pure-eval==0.2.2
[...]

@EliottTardieu
Copy link

EliottTardieu commented Aug 4, 2022

pip freeze gives

[...]
tqdm==4.64.0
LunarCalendar==0.0.9
pystan==2.19.1.1
prophet==1.0.1
[...]

I'm having the exact same issue as @wiktor2200 (0 rows when Enable Forecast is turned on). Running on Superset v1.5.1.

@wiktor2200
Copy link
Contributor

Hello! Today I've tried again with my Dockerfile and now prophet works in both 1.5.1 and 2.0.0 versions, so I suppose there were some problems with dependencies which were solved during the weekend.

@EliottTardieu
Copy link

Same here, but even Friday. For some reason when I tried again (using the exact same dockerfile), it worked.

@ecederstrand
Copy link
Contributor

ecederstrand commented Aug 16, 2022

Preinstalling lunarcalendar, tqdm and pystan is necessary because prophet <= 1.0 has a bug that requires these packages to be available when running setup.py to build the package. This was fixed in prophet 1.1 but that version can't be installed along with superset 2.0 due to a version conflict on the holidays package. I just contributed a fix for that conflict in #21091.

@596050
Copy link

596050 commented Jun 1, 2023

Just tried @john-bodley's branch, after getting stuck on this issue when trying to use prophet with superset in docker. Initially it did not work for me on the master branch or @john-bodley's. However, after pulling @john-bodley's branch: #24129 and then running

docker exec -it superset_app /bin/bash
# in container
pip uninstall fbprophet pystan
pip --no-cache-dir install pystan==2.19.1.1
pip install --upgrade pip
pip install lunarcalendar tqdm "pystan<3.0" && pip install "prophet>=1.0.1, <1.1"

Forecasting seems to be working consistently.

@michael-s-molina
Copy link
Member

@john-bodley Can we close this issue given #24129?

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

No branches or pull requests

8 participants