prophet icon indicating copy to clipboard operation
prophet copied to clipboard

Cannot use 'pip install fbprophet' to install prophet on mac

Open l0vest0rm opened this issue 9 years ago • 32 comments

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 /usr/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-1Wz6u0/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-fHkhKl-record/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_models INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_35bf14a7f93814266f16b4cf48b40a5a NOW. error: command 'cc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-1Wz6u0/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-fHkhKl-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-1Wz6u0/fbprophet/

l0vest0rm avatar Feb 25 '17 11:02 l0vest0rm

The fbprophet package requires pystan, which requires Cython. Try installing Cython with

pip install Cython

This should fix the issue.

Tafkas avatar Feb 25 '17 11:02 Tafkas

the problem exists when Cython already installed

l0vest0rm avatar Feb 25 '17 23:02 l0vest0rm

This question suggests that maybe your XCode is outdated. Can you check cc --version. Here's mine:

sjt-mbp1:examples sjt$ cc --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

seanjtaylor avatar Feb 26 '17 02:02 seanjtaylor

it is ok now when i installed the xcode,thanks to seanjtaylor

l0vest0rm avatar Feb 27 '17 07:02 l0vest0rm

Failed install fbprophet. sudo pip3.5 install fbprophet

It stocks in Downloading fbprophet-0.1.1.tar.gz

I already installed Xcode and Cython.

Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

stories2 avatar Aug 16 '17 08:08 stories2

FWIW I am encountering same issue as @stories2

My cc --version:

Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Update: installing via conda works for me

thomzi12 avatar Aug 25 '17 16:08 thomzi12

@thomzi12 In my case, it just took soooooooooooo long time. Drink coffee. The time will solve your problem :)

stories2 avatar Sep 07 '17 04:09 stories2

I had the same issue and I could make it work that way:

git clone --recursive https://github.com/stan-dev/pystan.git
cd pystan
python setup.py install
pip install fbprophet

philipperemy avatar Jul 19 '18 05:07 philipperemy

Run into the same issue on MacOS ElCapitan (10.11.6). Nothing worked for me except for manually downgrading pystan package from 2.18 to 2.17.1.0.

matse004 avatar Sep 06 '18 13:09 matse004

Same issue I met when I install pystan (2.18.0.0) & fbprophet (0.3.post2) on macOS(10.13.6) Issue disappeared after downgrading pystan from 2.18 to 2.17.1.0 as matse004's suggestion.

jisumanbu avatar Nov 01 '18 02:11 jisumanbu

As @matse004 said, using pystan==2.17.1.0 rather than 2.18 works for me! Do as bellow:

sudo pip uninstall pystan
sudo pip install pystan==2.17.1.0
sudo pip install fbprophet

BruceBinBoxing avatar Nov 25 '18 23:11 BruceBinBoxing

I have the same issue. I have tried all the mentioned fixes including downgrading pystan from 2.18 to 2.17.1.0 but still, it gives this error.

error: command '/usr/bin/clang' failed with exit status 1

hassheh avatar Feb 02 '19 23:02 hassheh

Installing via Conda fixed all problems for me

olivboom avatar Jul 08 '19 14:07 olivboom

Another solution that worked for me is force pip to use homebrew GCC compiler instead of CLANG

  1. After installing homebrew env CXX=/usr/local/Cellar/gcc/9.2.0/bin/g++-9 CC=/usr/local/Cellar/gcc/9.2.0/bin/gcc-9 pip install fbprophet==0.4.post2 or Add env variable in your bash rc file.

anshul-tak avatar Aug 26 '19 17:08 anshul-tak

I just want to chip in by saying that @anshul-tak's solution worked for me as well. Thanks for that, @anshul-tak.

For what it's worth, I use env CC=$(which gcc-9) CXX=$(which g++-9) pip install fbprophet which (no pun intended) is slightly more sustainable should the version of gcc change (currently it's at 9.2.0_3).

jeroenjanssens avatar Feb 04 '20 19:02 jeroenjanssens

Installing via Conda fixed all problems for me

This is the only thing that worked for me in the whole thread.

maddy2u avatar Jun 28 '20 17:06 maddy2u

export CC=$(which gcc) export CXX=$(which g++) pip install fbprophet And my error is: error: command 'clang' failed with exit status 1 This works, thanks @anshul-tak

buxizhizhoum avatar Oct 25 '20 08:10 buxizhizhoum

Hi, I have the same problems in installing Prophet. Irrespective of the two exports above, I still get the following error:

  Building wheel for fbprophet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/andreamoro/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/fbprophet/setup.py'"'"'; __file__='"'"'/private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/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 /private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-wheel-jmh6cp00
       cwd: /private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/fbprophet/
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/fbprophet
  creating build/lib/fbprophet/stan_model
  Importing plotly failed. Interactive plots will not work.
  INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
  error: command '/usr/bin/gcc' failed with exit status 1
  ----------------------------------------
  ERROR: 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
    ERROR: Command errored out with exit status 1:
     command: /Users/andreamoro/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/fbprophet/setup.py'"'"'; __file__='"'"'/private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/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 /private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-record-s04b7vvw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/andreamoro/.pyenv/versions/3.8.6/include/python3.8/fbprophet
         cwd: /private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/fbprophet/
    Complete output (10 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/fbprophet
    creating build/lib/fbprophet/stan_model
    Importing plotly failed. Interactive plots will not work.
    INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
    error: command '/usr/bin/gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/andreamoro/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/fbprophet/setup.py'"'"'; __file__='"'"'/private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-install-dpr3g5ph/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 /private/var/folders/c_/ll8fp86d39d2qthh_cbg8vlc0000gp/T/pip-record-s04b7vvw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/andreamoro/.pyenv/versions/3.8.6/include/python3.8/fbprophet Check the logs for full command output.

I'm not using Anaconda or anything like it, Xcode is installed. As far as I can understand from the above, it seems the error code is due to some writing permission, which as a matter of fact are correct because on this working laptop IT prevents me to write into the private folder.

I had a look at the settings, but couldn't spot anything that allow me to specify a different folder.

Has anybody had a similar issue?

Thanks Andrea

andreamoro avatar Nov 23 '20 10:11 andreamoro

@andreamoro facing the same problem as you mentioned. Please update me if you find a solution thanks

vemuri-nath avatar Nov 25 '20 10:11 vemuri-nath

It might me a problem with pystan, which relies on C++ libraries that are not found where expected. I'm trying to speak with a developer there. Are you able to run pyStan and a demo example with success on your end @vemuri-nath ?

andreamoro avatar Nov 25 '20 10:11 andreamoro