Running setup.py install for fbprophet ... error
Asked Answered
U

9

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.

Undeceive answered 21/6, 2019 at 10:12 Comment(2)
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.Chanson
This answer might help you. https://mcmap.net/q/1094506/-import-pystan-_api-failed-importerror-dll-load-failed-the-specified-module-could-not-be-foundBeera
U
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.

Undeceive answered 21/6, 2019 at 21:12 Comment(0)
F
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

Fieldfare answered 21/6, 2019 at 10:17 Comment(11)
Thank you for your reply. No PyStan isn't working even though it said it successfully installed. How can I correctly install PyStan?Undeceive
@CamK Great. You can install: pip install pystan, also use the link in the answer which is: pystan.readthedocs.io/en/latest/windows.htmlFieldfare
@CamK I updated answer, let's remove pystan and cache and install it again.Fieldfare
d:\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directoryUndeceive
I receive that error when I run the second line "pip --no-cache-dir install pystan==2.17"Undeceive
@CamK remove its version and just run: "pip3 --no-cache-dir install pystan"Fieldfare
When I try pip --no-cache-dir install fbprophet, I still receive Running setup.py install for fbprophet ... errorUndeceive
@CamK try to skip it or remove version and just run: "pip --no-cache-dir install fbprophet"Fieldfare
Sadly, it gives the same error. I've added a picture.Undeceive
@CamK Do you have VS2015? or VS2017? another is, please run anaconda as administrator.Fieldfare
@CamK Please look at new answer for how to install pystanFieldfare
F
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

Fieldfare answered 21/6, 2019 at 11:32 Comment(6)
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"Undeceive
You should use one of these: conda activate stan or source activate stan but not both.Fieldfare
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.Fieldfare
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)Undeceive
@CamK, Great, you can skip gcc and follow my last answerFieldfare
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-3Undeceive
U
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.

Undeceive answered 21/6, 2019 at 21:12 Comment(0)
L
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 
Livvie answered 23/4, 2020 at 6:52 Comment(0)
V
1

(Short n Sweet) For Mac users :

  1. pip3 uninstall pystan
  2. pip3 install pystan==2.17.1.0
  3. pip3 install fbprophet
Valverde answered 14/1, 2022 at 19:0 Comment(0)
J
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!

Johannisberger answered 10/3, 2022 at 4:44 Comment(0)
G
1

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
Gymno answered 11/8, 2022 at 15:42 Comment(0)
F
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

Fieldfare answered 21/6, 2019 at 11:51 Comment(9)
Should I be using pip or anaconda?Undeceive
@CamK Search anaconda prompt and right click and select "run as administrator" , then run my last answerFieldfare
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'Undeceive
Honestly I feel that I may have to completely re-install anaconda and start from scratch.Undeceive
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 github.com/stan-dev/pystan.git , check your env, if you select Anaconda prompt then it is by default on the root.Fieldfare
My environment is (base) C:\WINDOWS\system32> and I am running as an administrator. It may be a permissions problem.Undeceive
ok, run cd.., then cd.., cd where you create" pystan" or in your anaconda, then follow above git cloneFieldfare
I changed my folder to my pystan folder. I then tried git clone --recursive 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 longUndeceive
I will now re-install anacondaUndeceive
L
0

From the horse's mouth: The package name is now prophet instead of fbprophet... so for latest python versions:

conda install -c conda-forge prophet

In particular, as we see with mamba here is what is available for fbprophet:

└─ fbprophet   is installable with the potential options
   ├─ fbprophet [0.1.1|0.1.post1|...|0.5] would require
   │  └─ python [2.7* |>=2.7,<2.8.0a0 ], which can be installed;
   ├─ fbprophet [0.1.1|0.1.post1|0.2|0.2.1|0.3.post2] would require
   │  └─ python [3.5* |>=3.5,<3.6.0a0 ], which can be installed;
   ├─ fbprophet [0.1.1|0.1.post1|0.2|0.2.1] would require
   │  └─ python 3.6* , which can be installed;
   ├─ fbprophet [0.3.post2|0.4.post2|0.5|0.6|0.7.1] would require
   │  └─ python >=3.6,<3.7.0a0 , which can be installed;
   ├─ fbprophet [0.5|0.6|0.7.1] would require
   │  └─ python >=3.7,<3.8.0a0 , which can be installed;
   └─ fbprophet 0.7.1 would require
      └─ python >=3.8,<3.9.0a0 , which can be installed.

In more detail, for linux, but assume similar for win, fbprophet is available in conda-forge for older python versions:

Name      Version   Build          Channel             
─────────────────────────────────────────────────────────
 fbprophet 0.7.1     py38h950e882_0 conda-forge/linux-64
 fbprophet 0.7.1     py37h3340039_0 conda-forge/linux-64
 fbprophet 0.7.1     py36h831f99a_0 conda-forge/linux-64
 fbprophet 0.6       py37he1b5a44_0 conda-forge/linux-64
 fbprophet 0.6       py36he1b5a44_0 conda-forge/linux-64
 fbprophet 0.5       py27he1b5a44_0 conda-forge/linux-64
 fbprophet 0.5       py27he1b5a44_1 conda-forge/linux-64
(... similar results of in between versions ...)
 fbprophet 0.1.1     np112py27_0    conda-forge/linux-64
 fbprophet 0.1.1     np111py36_0    conda-forge/linux-64
 fbprophet 0.1.1     np111py35_0    conda-forge/linux-64
 fbprophet 0.1.post1 py36_0         conda-forge/linux-64
 fbprophet 0.1.post1 py35_0         conda-forge/linux-64
 fbprophet 0.1.post1 py27_0         conda-forge/linux-64

while the same query for prophet returns:

Name    Version Build           Channel             
──────────────────────────────────────────────────────
 prophet 1.1.5   py310h56eac3b_1 conda-forge         
 prophet 1.1.5   py310h56eac3b_0 conda-forge/linux-64
 prophet 1.1.5   py310h56eac3b_1 conda-forge/linux-64
 prophet 1.1.5   py311h1fff0e1_0 conda-forge/linux-64
 prophet 1.1.5   py39h5ee1178_1  conda-forge/linux-64
 prophet 1.1.5   py39h5ee1178_0  conda-forge/linux-64
 prophet 1.1.5   py38h214270d_1  conda-forge/linux-64
 prophet 1.1.5   py38h214270d_0  conda-forge/linux-64
 prophet 1.1.5   py312h4f541b2_1 conda-forge/linux-64
 prophet 1.1.5   py311h1fff0e1_1 conda-forge/linux-64
 prophet 1.1.4   py38h214270d_0  conda-forge/linux-64
 prophet 1.1.4   py310h56eac3b_0 conda-forge/linux-64
 prophet 1.1.4   py311h1fff0e1_0 conda-forge/linux-64
 prophet 1.1.4   py39h5ee1178_0  conda-forge/linux-64
 prophet 1.1.4   py39h3c18c91_0  pkgs/main/linux-64  
(... similar results of in between versions ...)
 prophet 1.1     py39hf3d152e_1  conda-forge/linux-64
 prophet 1.1     py39hf3d152e_2  conda-forge/linux-64
 prophet 1.0.1   py37h06a4308_0  pkgs/main/linux-64  
 prophet 1.0.1   py38h06a4308_0  pkgs/main/linux-64  
 prophet 1.0.1   py39h06a4308_0  pkgs/main/linux-64  
 prophet 1.0.1   py37h89c1867_1  conda-forge/linux-64
 prophet 1.0.1   py37h085eea5_3  conda-forge/linux-64
 prophet 1.0.1   py36hcb3619a_3  conda-forge/linux-64
 prophet 1.0.1   py36h5fab9bb_5  conda-forge/linux-64
 prophet 1.0.1   py36h5fab9bb_4  conda-forge/linux-64
 prophet 1.0.1   py36h5fab9bb_2  conda-forge/linux-64
 prophet 1.0.1   py36h5fab9bb_1  conda-forge/linux-64
 prophet 1.0.1   py37h89c1867_2  conda-forge/linux-64
 prophet 1.0.1   py37h89c1867_4  conda-forge/linux-64
 prophet 1.0.1   py37h89c1867_5  conda-forge/linux-64
 prophet 1.0.1   py38h578d9bd_1  conda-forge/linux-64
 prophet 1.0.1   py38h578d9bd_2  conda-forge/linux-64
 prophet 1.0.1   py38h578d9bd_4  conda-forge/linux-64
 prophet 1.0.1   py38h578d9bd_5  conda-forge/linux-64
 prophet 1.0.1   py38ha770c72_1  conda-forge/linux-64
 prophet 1.0.1   py38hd0cf306_3  conda-forge/linux-64
 prophet 1.0.1   py39hf3d152e_5  conda-forge/linux-64
Lifeguard answered 24/11, 2023 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.