1

I cannot install fbprophet or gcc7.

I have manually installed a precompiled ephem.

Running setup.py install for fbprophet ... error

I have tried with python 3.6 and 3.7. I have tried running as administrator and without.

My anaconda prompt cannot install anything without throwing errors. I would rather use pip.

The problem may be related to pystan.

File "d:\python37\lib\site-packages\pystan\api.py", line 13, in <module> import pystan._api  # stanc wrapper
ImportError: DLL load failed: The specified module could not be found.

I am using windows 10.

Cam K
  • 127
  • 2
  • 2
  • 13
  • Run `python -c "from pip._internal.pep425tags import get_supported; print(get_supported()[0])"` from the terminal and post the output here. Make sure to use the desired target version of Python, e.g. `py -3.7` instead of `python` in command if needed. – hoefling Jun 21 '19 at 12:30
  • This answer might help you. https://stackoverflow.com/a/64713567/10126125 – Akalanka Weerasooriya Nov 06 '20 at 13:59

8 Answers8

11

Use: The first step is to remove pystan and cache:

pip uninstall fbprophet pystan
pip --no-cache-dir install pystan==2.17  #any version
pip --no-cache-dir install fbprophet==0.2 #any version
conda install Cython --force

pip install pystan
conda install pystan -c conda-forge
conda install -c conda-forge fbprophet

It creates a wheel and update the environment necessary for the package. pip install fbprophet creates the similar issue.

Be sure that pystan is working.

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)
y = model.sampling().extract()['y']
y.mean()  # with luck the result will be near 0

Use this link: Installing PyStan on windows

Mahsa Hassankashi
  • 2,086
  • 1
  • 15
  • 25
1

Reason: The python distribution on Anaconda3 uses an old version of gcc (4.2.x)

Please use anaconda prompt as administrator

set a new environment for a stan

conda create -n stan python=<your_version> numpy cython

install pystan and gcc inside the virtual environment.

conda activate stan   

or

source activate stan
(stan)  pip install pystan
(stan)  pip install gcc

verify your gcc version:

gcc --version
gcc (GCC) 4.8.5

enter image description here

Mahsa Hassankashi
  • 2,086
  • 1
  • 15
  • 25
  • My anaconda prompt fails to install anything due to ipykernel. That's a separate issue. I cannot install gcc on pip. pip install gcc7 "cannot find a version" – Cam K Jun 21 '19 at 11:38
  • You should use one of these: conda activate stan or source activate stan but not both. – Mahsa Hassankashi Jun 21 '19 at 11:42
  • That issue is because of your environment (stan), I have python 3.7.3 and Visual Studio 2017 and run my anaconda as administrator and I could install pystan. Look at the picture I uploaded in answer. – Mahsa Hassankashi Jun 21 '19 at 11:45
  • I am using python 3.7.0 with visual studio 2017 . When I run pip install gcc I get ERROR: Could not find a version that satisfies the requirement gcc (from versions: none) – Cam K Jun 21 '19 at 11:57
  • @CamK, Great, you can skip gcc and follow my last answer – Mahsa Hassankashi Jun 21 '19 at 11:58
  • Executing transaction: | ERROR conda.core.link:_execute_post_link_actions(658): An error occurred while installing package 'defaults::m2-base-1.0.0-3'. LinkError: post-link script failed for package defaults::m2-base-1.0.0-3 – Cam K Jun 21 '19 at 12:06
1

To solve this problem, I uninstalled my existing python 3.7 and anaconda. I re-installed anaconda with one key difference.

I registered Anaconda as my default Python 3.7 during the Anaconda installation. This lets visual studio, PyDev and other programs automatically detect Anaconda as the primary version to use.

Cam K
  • 127
  • 2
  • 2
  • 13
1

I tried to import fbprophet on Python Anaconda, however, I got some errors.

This code works for me..

conda install -c conda-forge/label/cf201901 fbprophet 
David Buck
  • 3,752
  • 35
  • 31
  • 35
1

(Short n Sweet) For Mac users :

  1. pip3 uninstall pystan
  2. pip3 install pystan==2.17.1.0
  3. pip3 install fbprophet
awakened_iota
  • 580
  • 5
  • 13
1

I used the following steps to install fbprophet 0.7.1 on windows 10 (2022-03-10):

  1. Install anaconda here.
  2. Install pystan by following this guide. The main line I used was conda install libpython m2w64-toolchain -c msys2. Then, install pystan using pip install pystan
  3. Check your installation by running the following in a python terminal:
>>> import pystan
>>> model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
>>> model = pystan.StanModel(model_code=model_code)
>>> y = model.sampling().extract()['y']
>>> y.mean()  # with luck the result will be near 0
  1. If the above works, proceed to install fbprophet with pip install fbprophet

Hope this works for you!

IK Cheng
  • 11
  • 1
  • 3
0

enter image description hereIf all of the answers did not work lets clone pystan and do not use the above solutions:

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

enter image description here

Mahsa Hassankashi
  • 2,086
  • 1
  • 15
  • 25
  • Should I be using pip or anaconda? – Cam K Jun 21 '19 at 12:08
  • @CamK Search anaconda prompt and right click and select "run as administrator" , then run my last answer – Mahsa Hassankashi Jun 21 '19 at 12:12
  • error: unable to create file lib/boost_1.69.0/libs/geometry/doc/html/geometry/reference/spatial_indexes/boost__geometry__index__rtree/rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html: Filename too long Unable to checkout 'c2fb25c3f53d3d33157a27ce995911b0bc92d55d' in submodule path 'pystan/stan/lib/stan_math' Failed to recurse into submodule path 'pystan/stan' – Cam K Jun 21 '19 at 12:23
  • Honestly I feel that I may have to completely re-install anaconda and start from scratch. – Cam K Jun 21 '19 at 12:23
  • Dear @CamK I am sure it is because of your env, please look at env, for example for me is: (base) C:\Windows\system32> git clone --recursive https://github.com/stan-dev/pystan.git , check your env, if you select Anaconda prompt then it is by default on the root. – Mahsa Hassankashi Jun 21 '19 at 12:28
  • My environment is (base) C:\WINDOWS\system32> and I am running as an administrator. It may be a permissions problem. – Cam K Jun 21 '19 at 12:32
  • ok, run cd.., then cd.., cd where you create" pystan" or in your anaconda, then follow above git clone – Mahsa Hassankashi Jun 21 '19 at 12:34
  • I changed my folder to my pystan folder. I then tried git clone --recursive https://github.com/stan-dev/pystan.git . I received the following error error: unable to create file lib/boost_1.69.0/libs/geometry/doc/html/geometry/reference/spatial_indexes/boost__geometry__index__rtree/rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html: Filename too long – Cam K Jun 21 '19 at 16:27
  • I will now re-install anaconda – Cam K Jun 21 '19 at 16:28
0

It looks like fbprophet renamed to prophet on the FB side, so this command worked for me (Windows 10 + VSCode + Python 3.10.2)

pip install prophet --no-cache-dir
ihsany
  • 870
  • 10
  • 12