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)
I followed the instructions (in a completely new conda environment) but I am still facing the same issue:
Seeing the same issue. Is it possible to get an arm64 build for Apple Silicon via conda-forge? đ
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 virtualenvpip3 install virtualenvwrapperbrew install pyenv-virtualenvYou need these commands to have virtual env running under pyenv. Next, install python
pyenv install 3.8.10Create env called âprophetâ:
pyenv virtualenv 3.8.10 prophetActivate it in your working directory:
pyenv local prophetInstall 2 packages:
pip install pystan==2.19.1.1pip install prophetIt worked fine for me!
On my Macbook Pro M1, I install miniforge by
Visit https://github.com/conda-forge/miniforge for more info.
Then create a python environment
Then I install pystan and prophet with pip one at a time
I also tried installing in one go with success
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.2withpython 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) addexport PROPHET_REPACKAGE_CMDSTAN=Falseto 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.1andpython3 10.6on M2 macbook air. It firstly complains about libtbb.dylib, but I simplyfind /opt/homebrew/Caskroom/miniforge -name libtbb*and copy thelibtbb*dylibto/opt/homebrew/Caskroom/miniforge/base/liband restart the ipython/jupyter kernel and finally it can find the requiredlibtbb*.Edit: I use macos ventura. The installation is simpy
conda install pystanandpip install prophetI am having the same runtime issue of the missing
libtbb.dylibusingprophet==1.1onMacOS 12.2.1M1 andPython 3.10.4Iâ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.13cmdstanpy0.9.68(pip installed) prophet1.0(pip installed) pystan2.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 directoryand inside a huge output of cmdstan building process there are such things as:I was following advice from @nicolaivico to use
PROPHET_REPACKAGE_CMDSTAN=Falsebut with some changes. So here you go: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:
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: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:
Next, install python
pyenv install 3.8.10Create env called âprophetâ:
pyenv virtualenv 3.8.10 prophetActivate it in your working directory:
pyenv local prophetInstall 2 packages:
If you face this error: âCmdStan failed to install in repackaged directoryâ, try doing this:
export PROPHET_REPACKAGE_CMDSTAN=FalseIf 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:And try to run this command again:
pip install prophetAnd 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) cmdstanpy0.9.68(pip installed) prophet1.0(pip installed) pystan2.19.1.1(pip installed)Steps to reproduce:
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 prophetdirectly from PyPI for Python 3.9 and 3.10