Prophet: pip install fbprophet fails on osx 13.6

Created on 21 Oct 2018  路  4Comments  路  Source: facebook/prophet

I am running OSX 13.6 (High Sierra) and Anaconda python v2.7.

_pip install fbprophet_ gives:

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 "/Users/ihf/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-g06yX1/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-record-nESHEA/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/y2/38gkkc0s7d52_mr_s6zfj7m80000gq/T/pip-install-g06yX1/fbprophet/

Can anyone please tell me how I can get this to install?

Most helpful comment

Usually the source of this issue is that PyStan is not working due to the C++ compiler not working properly.
You can check if PyStan is working with

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

The install is a little more complicated with Anaconda because it has a separate build environment from system python. The easiest way to install fbprophet in Anaconda is through conda forge:

conda install gcc
conda install -c conda-forge fbprophet

Does that work?

All 4 comments

Running Win10, Python 3.7 (Anaconda) and getting a similar error

  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=k_s) 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_db8febf10f23d7fa27a62fbcfd7f17b2 NOW.
  error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1

Usually the source of this issue is that PyStan is not working due to the C++ compiler not working properly.
You can check if PyStan is working with

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

The install is a little more complicated with Anaconda because it has a separate build environment from system python. The easiest way to install fbprophet in Anaconda is through conda forge:

conda install gcc
conda install -c conda-forge fbprophet

Does that work?

Was having problems both with installing fbprophet and running pystan. I can confirm that the solution suggest by @bletham worked for both problems. Big thanks!

@bletham could you please help, maybe your solution is close to the one I am looking for.

I think this issue is related to compiler:

Python 3.7.4 (default, Aug 13 2019, 15:17:50) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fbprophet
dyld: lazy symbol binding failed: Symbol not found: _fdopendir$INODE64
  Referenced from: /Users/gg4u/Sites/miniconda3/envs/meteo/bin/python
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _fdopendir$INODE64
  Referenced from: /Users/gg4u/Sites/miniconda3/envs/meteo/bin/python
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap: 5
````

I am running mac os 1.9.5

tried to install gcc compiler via conda:
`conda -c conda-forge gcc -n myenv``
then 
`conda -c conda-forge fbprophet -n myenv``

still same error with :
`/usr/lib/libSystem.B.dylib`


pystan indeed failed , same error:

dyld: lazy symbol binding failed: Symbol not found: _fdopendir$INODE64
Referenced from: /Users/gg4u/Sites/miniconda3/envs/meteo/bin/python
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _fdopendir$INODE64
Referenced from: /Users/gg4u/Sites/miniconda3/envs/meteo/bin/python
Expected in: /usr/lib/libSystem.B.dylib
````

Was this page helpful?
0 / 5 - 0 ratings

Related issues

germayneng picture germayneng  路  3Comments

kimhale picture kimhale  路  3Comments

davidjayjackson picture davidjayjackson  路  3Comments

andrew-pollock picture andrew-pollock  路  3Comments

L471 picture L471  路  3Comments