question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
wiktor2200commented, Aug 4, 2022

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.

1reaction
mdeshmucommented, 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”

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'lunarcalendar' #2033
I hit ModuleNotFoundError: No module named 'lunarcalendar' when installing prophet. Building wheels for collected packages: prophet Building ...
Read more >
How to successfully install fbprophet via Gitlab CI?
The issue with fbprophet is that it imports and executes its own code in setup.py . This is sometimes called a "race condition", ......
Read more >
LunarCalendar - PyPI
A lunar calendar converter, including a number of lunar and solar holidays ... an error like command 'gcc' failed with exit status 1...
Read more >
[GitHub] [superset] ecederstrand commented on issue #20901 ...
[GitHub] [superset] ecederstrand commented on issue #20901: [prophet] prophet installation fails with ModuleNotFoundError: No module named 'lunarcalendar'.
Read more >
No module named 'lunarcalendar' - Copy Paste Guru
How to fix "ModuleNotFoundError: No module named 'lunarcalendar'" ... You must first install the package before you can use it in your code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found