prophet
prophet copied to clipboard
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.
Hmmm simple one to start with: can you try conda install -c conda-forge prophet
? (not fbprophet
)
If that doesn't work we might have to do some more digging.
Same thing for me, and with conda install -c conda-forge prophet
I get:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
This is with a fresh conda env in python 3.8
@adriendod Could you post the rest of the message? It should tell us which package versions aren't compatible
Well this is weird because this is the full message! It doesn't tell us which package is causing the issue. :/
it still doesn't install on Mac m1, like OP, I get this now :
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:
- prophet
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.
It is not available in the OSX arm channel?
Seeing the same issue. Is it possible to get an arm64 build for Apple Silicon via conda-forge? 🙏
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
From trial and error, I am able to install Prophet in Python 3.8 with pip
, and not able to in Python 3.9 and above.
Note that the installation will be successful under Python 3.9, but forecasting will fail because it cannot locate the "cmdstan" libraries.
M1, Monterey Version 12.1
Hello @nlhkh ,
Could you please tell me how did you install prophet with python 3.8?
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.
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?
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!
Same here - M1, Monterey v12.2.1, works using python 3.8.11, does not work using python 3.9.x
This has been resolved in prophet 1.1. You can now pip install prophet
directly from PyPI for Python 3.9 and 3.10
pip install prophet
I followed the instructions (in a completely new conda environment) but I am still facing the same issue:
@aabuabat you can resolve this issue by downgrading your prophet installation to prophet==1.0.
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)
pystan
2.19.1.1
(conda-forge installed)
this doesnt work on these m1 since pystan fails on prophet==1.0 but not 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.
Same issue here with Python 3.9.6
, both prophet==1.0
and prophet==1.1
and MacOS 12.6
.
Did someone get it to work any way other than to downgrade Python ?
@michaelhodara @eliwoods
I've tried using 'python=3.9.x' quite a while. The problem (as far as I could identify it) was always 'cmdpystan', when I ran it through the debugger. Worth a try: built cmdpytan and postman from source. That compiles a version for your system. If you cannot downgrade python, I fear you need to look through the package yourself. I don't see any reason why it technically shouldn't with 'python>3.8.x'.
Otherwise you can run all Prophet dependencies and tasks in a separated venv. Hope it helps a bit :)
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*
.
Edit: I use macos ventura. The installation is simpy conda install pystan
and pip install prophet
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/
If you are in python3.9+ it was not supported yet. I encountered same issue when I was in python3.9+. When I tried to install a lower version. e.g. 3.7.2, now it works!
python 3.8.15, pystan from conda, prophet 1.1 from pip, had an error: Symbol not found: "__ZNSt11range_errorD1Ev"
had to do this to fix it: remove libtbb.12.7.dylib
, libtbb.12.dylib
and libtbb.dylib
from ~/miniconda3/lib/
, symlink the replacement from prophet package:
cd ~/miniconda3/lib
ln -s ~/miniconda3/lib/python3.8/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib libtbb.12.7.dylib
ln -s ~/miniconda3/lib/python3.8/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib libtbb.12.dylib
ln -s ~/miniconda3/lib/python3.8/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/libtbb.dylib libtbb.dylib
These two worked for me:
cp ~/miniforge3/envs/ds/lib/python3.10/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/*.dylib ~/miniforge3/lib
sudo cp ~/miniforge3/envs/ds/lib/python3.10/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/*.dylib /usr/local/lib/
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
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.
@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 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!
I got it working on my Apple M2 Pro machine!
I had to fix 1 line after install and make 3 symlinks for not loaded libraries.
See the post:
https://stackoverflow.com/a/76264243/1396899