prophet: Can't install Fbprophet with Conda (or pip) in an Apple M1

I tried installing FBProphet via Conda in an Apple MacBook 13 M1 but I was unsuccessful (I also tried via pip). This is what I get:

fj@fj-MacBook-Pro ~ % conda install -c conda-forge fbprophet
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - fbprophet

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.

Any thoughts or a feasible way to install it? I am game.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 35 (2 by maintainers)

Most upvoted comments

pip install prophet

I followed the instructions (in a completely new conda environment) but I am still facing the same issue:

Screen Shot 2022-07-11 at 13 30 42

Seeing the same issue. Is it possible to get an arm64 build for Apple Silicon via conda-forge? 🙏

Hello @nlhkh ,

Could you please tell me how did you install prophet with python 3.8?

I have macOS Monterey, v12.0.1 Prophet was successfully installed using python 3.8. It did NOT work with 3.9.6 version. I use pyenv to create virtual env. That is what I did:

pip3 install virtualenv pip3 install virtualenvwrapper brew install pyenv-virtualenv

You need these commands to have virtual env running under pyenv. Next, install python pyenv install 3.8.10

Create env called ‘prophet’: pyenv virtualenv 3.8.10 prophet

Activate it in your working directory: pyenv local prophet

Install 2 packages: pip install pystan==2.19.1.1 pip install prophet

It worked fine for me!

Hello @nlhkh ,

Could you please tell me how did you install prophet with python 3.8?

On my Macbook Pro M1, I install miniforge by

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge-$(uname)-$(uname -m).sh
# Then follow the instruction to activate miniconda.

Visit https://github.com/conda-forge/miniforge for more info.

Then create a python environment

conda create -n test python=3.8

Then I install pystan and prophet with pip one at a time

pip install pystan==2.19.1.1
pip install prophet

I also tried installing in one go with success

pip install pystan==2.19.1.1 prophet
# or
pip install prophet

Prophet installation will throw out lots of errors about not having dependencies, or build failures, but that’s okay. It will install those missing dependencies, and resume the build.

Hey, Got error for first time, while installing prophet through terminal. Installed pystan through Anaconda GUI. restarted terminal, executed:

conda install -c conda-forge prophet

and was installed successfully.

M1, Big Sur Version 11.4

Hi … I’m running vanilla python 3.9.6 without conda on an M1 Mac running Ventura 13.2.1, and got it working with the latest cmdstan and prophet versions. Now downgrades needed. Here’s what I did:

a) download the latest cmdstan code and build it yourself (basically “make build”) b) put the files in bin into /usr/local/bin c) run export PROPHET_REPACKAGE_CMDSTAN=False pip install prophet

The last command tells prophet not to use its older hacked version of cmdstan that doesn’t support the M1, but just use the version that’s installed. Things seem to work great now.

@aabuabat you can resolve this issue by downgrading your prophet installation to prophet==1.0.

@willer’s solution doing PROPHET_REPACKAGE_CMDSTAN=False worked for me on Apple M1 Pro, MacOS Ventura 13.1. I have installed prophet 1.1.2 with python 3.9.16.

I was running into the error: “CmdStan failed to install in repackaged directory”. That’s because of a bug in cmdstanpy (https://github.com/stan-dev/cmdstan/pull/1127) which was fixed in the latest versions of cmdstanpy. However, prophet=1.1.2 is still using an old version of cmdstanpy where this bug materializes for some Mac M1 users (CMDSTAN_VERSION = “2.26.1”).

What I did: a) Create a python environment (venv or conda) and install the library cmdstanpy (simply with pip install --upgrade cmdstanpy). This library downloads CmdStan from GitHub and builds the CmdStan utilities. Read more here: https://cmdstanpy.readthedocs.io/en/v0.9.75/installation.html#install-package-cmdstanpy b) add export PROPHET_REPACKAGE_CMDSTAN=False to my terminal environment settings file (open and edit with the command: nano ~/.zshrc)
c) check if the environment variable was set with command: echo "$PROPHET_REPACKAGE_CMDSTAN" in a new terminal window, if it doesn’t print False, then probably your default terminal is bash not zsh, so edit the bash profile (nano ~/.bash_profile)

I successfully run the sample code @aabuabat above using prophet 1.1.1 and python3 10.6 on M2 macbook air. It firstly complains about libtbb.dylib, but I simply find /opt/homebrew/Caskroom/miniforge -name libtbb* and copy the libtbb*dylib to /opt/homebrew/Caskroom/miniforge/base/lib and restart the ipython/jupyter kernel and finally it can find the required libtbb*. Screenshot 2022-10-22 at 5 48 01 AM

Edit: I use macos ventura. The installation is simpy conda install pystan and pip install prophet

I am having the same runtime issue of the missing libtbb.dylib using prophet==1.1 on MacOS 12.2.1 M1 and Python 3.10.4

I’ve seen elsewhere that people can get it to work using previous versions of prophet on python 3.8, but I would love to not downgrade our entire ETL stack from 3.10 to 3.8 just to run Prophet.

Worked for me with following configuration:

OS: MacOS 12.4 Monterey (Apple M1 Pro; so all the Arm64 builts for compilers, used clang 12.0.0 as C++ compiler) python 3.8.13 cmdstanpy 0.9.68 (pip installed) prophet 1.0 (pip installed) pystan 2.19.1.1 (conda-forge installed)

Hey, guys!

I also cannot install prophet 1.1.4, Apple M1, python 3.9. The error is RuntimeError: CmdStan failed to install in repackaged directory and inside a huge output of cmdstan building process there are such things as:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/complex:665:23: error: no matching function for call to '__constexpr_copysign'

I was following advice from @nicolaivico to use PROPHET_REPACKAGE_CMDSTAN=False but with some changes. So here you go:

pip install cmdstanpy
install_cmdstan --version 2.33.0 --cores 4 
# by this moment you will have cmdstan installed into ~/.cmdstan/

export PROPHET_REPACKAGE_CMDSTAN=False
pip install prophet=1.1.3
# poetry works too

So why v2.33.0? I’ve tried v2.31.0 (which prophet depends on in v1.1.4), it’s the same building errors. Same for v2.32.0, but v2.33.0 worked out. I supposed they fixed something related to clang.

Why not prophet 1.1.4? It failed installation:

ValueError: invalid stan filename /private/var/folders/r3/klmqxsjj1nq8hlbqbfkyvtj00000gr/T/tmpxlutgt_n/prophet-1.1.4/build/lib.macosx-13.2-arm64-cpython-39/prophet/stan_model/cmdstan-2.31.0

While 1.1.3 worked out well. I suppose the latest changes broke something.

So it’s working, no panic 😎 Cheers!

I was facing the same problem of “CmdStan failed to install in repackaged directory”. and tried your solution, which resulted in ValueError: No CmdStan installation found, run command "install_cmdstan"or (re)activate your conda environment! error for me. So, I installed cmdstan (not sure why it didn’t earlier) by these 2 commands:

>>> from cmdstanpy import install_cmdstan
>>> install_cmdstan()

and did install prophet, and it worked. So, summarizing the steps for the successful installation (which worked for me): My environment (MacOS Ventura 13.3.1, M1 Max) For virtualenv using pyenv:

pip3 install virtualenv
pip3 install virtualenvwrapper
brew install pyenv-virtualenv

Next, install python pyenv install 3.8.10

Create env called ‘prophet’: pyenv virtualenv 3.8.10 prophet

Activate it in your working directory: pyenv local prophet

Install 2 packages:

pip install pystan==2.19.1.1
pip install prophet

If you face this error: “CmdStan failed to install in repackaged directory”, try doing this: export PROPHET_REPACKAGE_CMDSTAN=False

If you still face some issue like ValueError: No CmdStan installation found, run command "install_cmdstan"or (re)activate your conda environment!, do this in your python console:

>>> from cmdstanpy import install_cmdstan
>>> install_cmdstan()

And try to run this command again: pip install prophet

And it works!

Worked for me with the following versions:

OS: MacOS 12.4 Monterey (Apple M1 Pro) python 3.9.16 ([Clang 14.0.0 (clang-1400.0.29.202)] on darwin) cmdstanpy 0.9.68 (pip installed) prophet 1.0 (pip installed) pystan 2.19.1.1 (pip installed)

Steps to reproduce:

python3.9 -m venv env
source env/bin/activate
python3.9 -m pip install prophet==1.0
python3.9 -m pip install pystan

I got prophet to work on m1 with python=3.10 by using rosetta (intel arch emulator). Here is a blog which details how you can manage two conda installations for each architecture on an m1: https://taylorreiter.github.io/2022-04-05-Managing-multiple-architecture-specific-installations-of-conda-on-apple-M1/

This has been resolved in prophet 1.1. You can now pip install prophet directly from PyPI for Python 3.9 and 3.10