First, I am using ubuntu and used command 'conda install -c conda-forge fbprophet'
it didn't work.
my error is like below:
Collecting fbprophet
Using cached https://files.pythonhosted.org/packages/3e/93/32b258aa95a42d601a2b4da21f78a19869d0a33f568824b27a1677b0b9ce/fbprophet-0.4.tar.gz
Requirement already satisfied: Cython>=0.22 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (0.29.2)
Requirement already satisfied: pystan>=2.14 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (2.18.1.0)
Requirement already satisfied: numpy>=1.10.0 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (1.15.4)
Requirement already satisfied: pandas>=0.20.1 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (0.23.4)
Requirement already satisfied: matplotlib>=2.0.0 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (3.0.2)
Requirement already satisfied: lunardate>=0.1.5 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (0.2.0)
Requirement already satisfied: convertdate>=2.1.2 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (2.1.3)
Requirement already satisfied: holidays>=0.9.5 in ./anaconda3/lib/python3.7/site-packages (from fbprophet) (0.9.9)
Requirement already satisfied: python-dateutil>=2.5.0 in ./anaconda3/lib/python3.7/site-packages (from pandas>=0.20.1->fbprophet) (2.7.5)
Requirement already satisfied: pytz>=2011k in ./anaconda3/lib/python3.7/site-packages (from pandas>=0.20.1->fbprophet) (2018.7)
Requirement already satisfied: cycler>=0.10 in ./anaconda3/lib/python3.7/site-packages (from matplotlib>=2.0.0->fbprophet) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./anaconda3/lib/python3.7/site-packages (from matplotlib>=2.0.0->fbprophet) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./anaconda3/lib/python3.7/site-packages (from matplotlib>=2.0.0->fbprophet) (2.3.0)
Requirement already satisfied: ephem<3.8,>=3.7.5.3 in ./anaconda3/lib/python3.7/site-packages (from convertdate>=2.1.2->fbprophet) (3.7.6.0)
Requirement already satisfied: six in ./anaconda3/lib/python3.7/site-packages (from holidays>=0.9.5->fbprophet) (1.12.0)
Requirement already satisfied: setuptools in ./anaconda3/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->fbprophet) (40.6.3)
Building wheels for collected packages: fbprophet
Running setup.py bdist_wheel for fbprophet ... error
Complete output from command /home/pirl/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-aektqk54/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-0re7lefo --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/fbprophet
creating build/lib/fbprophet/stan_model
DIAGNOSTIC(S) FROM PARSER:
Warning: left-hand side variable (name=cp_idx) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
Warning: left-hand side variable (name=m_pr) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_861b75c6337e237650a61ae58c4385ef NOW.
error: command 'gcc' failed with exit status 1
Failed building wheel for fbprophet
Running setup.py clean for fbprophet
Failed to build fbprophet
Installing collected packages: fbprophet
Running setup.py install for fbprophet ... error
Complete output from command /home/pirl/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-aektqk54/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-f9ycheks/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/fbprophet
creating build/lib/fbprophet/stan_model
DIAGNOSTIC(S) FROM PARSER:
Warning: left-hand side variable (name=cp_idx) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
Warning: left-hand side variable (name=m_pr) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_861b75c6337e237650a61ae58c4385ef NOW.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/pirl/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-aektqk54/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-f9ycheks/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-aektqk54/fbprophet/
Is this the output of the conda-forge install or a pip install? Conda-forge doesn't yet have v0.4 so I'm wondering if this is pip.
It seems that pystan is not working, which is causing the model compiling to fail when installing fbprophet. Try re-installing pystan through conda forge and then check that it is working by running:
import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code) # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean() # should be close to 0
0.4 is now on conda forge, so installing it from there should resolve the issue.
I've had the same problem. But it works after I follow this steps:
On Prompt install Ephem:
conda install -c anaconda ephem
Install Pystan:
conda install -c conda-forge pystan
Finally install Fbprophet
conda install -c conda-forge fbprophet
Lonely锛歩f you don't have conda or even you have conda锛寉ou can use these two simple command:
python3 -m pip install pystan==2.17.1.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
and then
python3 -m pip install fbprophet -i https://pypi.tuna.tsinghua.edu.cn/simple
now, you may success~
I resolved this issue on my Fedora 31 machine using:
sudo dnf install gcc-g++
I prefer dnf over yum, but either way, leaving this comment in case it helps anyone else.
Lonely锛歩f you don't have conda or even you have conda锛寉ou can use these two simple command:
python3 -m pip install pystan==2.17.1.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
and then
python3 -m pip install fbprophet -i https://pypi.tuna.tsinghua.edu.cn/simple
now, you may success~
For those who might face the same issue in centos with version around 7.8, downgrading the pystan is exactly the way to solve the problem.
Thanks again for posting.
Most helpful comment
Lonely锛歩f you don't have conda or even you have conda锛寉ou can use these two simple command:
python3 -m pip install pystan==2.17.1.0 -i https://pypi.tuna.tsinghua.edu.cn/simpleand then
python3 -m pip install fbprophet -i https://pypi.tuna.tsinghua.edu.cn/simplenow, you may success~