Running setup.py install for fbprophet … error

2019-08-29 02:11发布

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.

4条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-29 02:29

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

查看更多
欢心
3楼-- · 2019-08-29 02:37

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

查看更多
Ridiculous、
4楼-- · 2019-08-29 02:37

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.

查看更多
混吃等死
5楼-- · 2019-08-29 02:44

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

查看更多
登录 后发表回答