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

Python prophet installation fails in Docker #2138

Closed
Franky1 opened this issue Mar 15, 2022 · 5 comments
Closed

Python prophet installation fails in Docker #2138

Franky1 opened this issue Mar 15, 2022 · 5 comments

Comments

@Franky1
Copy link

Franky1 commented Mar 15, 2022

docker run -ti --rm python:3.8-slim /bin/bash
pip install prophet

fails with

ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Failed building wheel for prophet
@Franky1
Copy link
Author

Franky1 commented Mar 15, 2022

I have a working solution, which seems to build without errors.
It uses a 3-step pip installation.

FROM python:3.9-slim

# we probably need build tools?
RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
    build-essential

# we need the requirements.txt file from prophet to be in the root of the project
# https://github.com/facebook/prophet/blob/main/python/requirements.txt
WORKDIR /app
COPY . .

# first: install all required packages for pystan
RUN pip install --no-cache-dir --upgrade cython numpy
# second: install all required packages for prophet from their requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# third: install prophet itself
RUN pip install --no-cache-dir --upgrade prophet

However, the whole installation is a pain.
Could you please fix this, that this pip installation works in the major OSes:

pip install prophet

@thomasaarholt
Copy link

I believe this is part of what #2041 is about, with a fix being finalised for this problem in #2088.

@tcuongd tcuongd added the py label May 22, 2022
@tcuongd
Copy link
Collaborator

tcuongd commented May 22, 2022

Please follow these instructions to install either the PyPI release or the development version:

The simple pip install won't work until we've uploaded the binaries to PyPI (currently a manual process).

@akosfurton
Copy link

This has been resolved in prophet 1.1. You can now pip install prophet directly from PyPI

@Franky1
Copy link
Author

Franky1 commented Jun 27, 2022

Yes, i tested it already yesterday, when the new version came out and it worked without issues.
Issue can be closed.

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

No branches or pull requests

4 participants