Linux安装fbprophet的一些错误和解决办法
刺绣中常见的错误与解决办法 #生活技巧# #手工DIY技巧# #手工刺绣#
首先按照官网安装,可以看到需要安装pystan,在对应的页面告诉我们pystan安装需要anaconda,还是先去装anaconda把,安装方法就是去官网下载sh文件,执行bash指令就行,之后pip安装gcc,pystan等,但是用pip安装fbprophet的时候报错
[root@ml-cent-2 site-packages]
Collecting fbprophet
Downloading https://files.pythonhosted.org/packages/83/a1/a39be1675a62597e4c0d4fdaeb65b14752b8aa8afc92e90edd91614353ab/fbprophet-0.3.post2.tar.gz
Requirement already satisfied: Cython>=0.22 in /root/anaconda3/lib/python3.6/site-packages (from fbprophet) (0.28.2)
Requirement already satisfied: pystan>=2.14 in /root/anaconda3/lib/python3.6/site-packages (from fbprophet) (2.17.1.0)
Requirement already satisfied: numpy>=1.10.0 in /root/anaconda3/lib/python3.6/site-packages (from fbprophet) (1.14.3)
Requirement already satisfied: pandas>=0.20.1 in /root/anaconda3/lib/python3.6/site-packages (from fbprophet) (0.23.0)
Requirement already satisfied: matplotlib>=2.0.0 in /root/anaconda3/lib/python3.6/site-packages (from fbprophet) (2.2.2)
Requirement already satisfied: python-dateutil>=2.5.0 in /root/anaconda3/lib/python3.6/site-packages (from pandas>=0.20.1->fbprophet) (2.7.3)
Requirement already satisfied: pytz>=2011k in /root/anaconda3/lib/python3.6/site-packages (from pandas>=0.20.1->fbprophet) (2018.4)
Requirement already satisfied: cycler>=0.10 in /root/anaconda3/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /root/anaconda3/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (2.2.0)
Requirement already satisfied: six>=1.10 in /root/anaconda3/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (1.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /root/anaconda3/lib/python3.6/site-packages (from matplotlib>=2.0.0->fbprophet) (1.0.1)
Requirement already satisfied: setuptools in /root/anaconda3/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->fbprophet) (39.1.0)
Building wheels for collected packages: fbprophet
Running setup.py bdist_wheel for fbprophet ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-1g925uox/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 /tmp/pip-wheel-hjvqj981 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/fbprophet
creating build/lib/fbprophet/stan_model
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_861b75c6337e237650a61ae58c4385ef NOW.
error: command 'gcc' failed with exit status 1
----------------------------------------
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 /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-1g925uox/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-record-42uk60yu/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_model
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_861b75c6337e237650a61ae58c4385ef NOW.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-1g925uox/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-record-42uk60yu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-1g925uox/fbprophet/
去外国网站查,有人说用
conda install -c conda-forge fbprophet
conda install gcc
但是我conda的proxy设置有些问题,就没试过
最后找到了解决办法,少安装了gcc-c++的依赖库
So the issue is with pystan and in particular something in the C++ compiler. Could you try making sure that these packages are installed in Fedora:
@centos
sudo yum install gcc gcc-c++
@Ubuntu
sudo apt-get install build-essential
之后使用
pip install fbprophet
或者直接下载github上的源代码,进入python目录使用
python3 setup.py install
都可以安装成功
但是用pip安装的在之后使用发现会出现缺少库
>>> import matplotlib
>>> import fbprophet
ERROR:fbprophet.plot:Importing matplotlib failed. Plotting will not work.
还以为没安装,实际上是安装了但是和fbprophet不在相同路径中
[root@cent-3 spark-2.3.1-bin-hadoop2.7]
Requirement already satisfied: matplotlib in /root/anaconda3/lib/python3.6/site-packages (2.2.2)
因为实际查看后发现路径是包含matplotlib安装位置的
>>> import sys
>>> print(sys.path)
['', ...,'/root/anaconda3/lib/python3.6/site-packages']
用pip卸载fbprophet后用github的代码装,还是会出现同样错误
去官方github讨论区查看
In v0.3 you can now load prophet without matplotlib installed and it will just print a warning (not fail with ImportError). It is still listed as a install dependency in PyPI, but you can get around that by installing from source (python setup.py install) and removing matplotlib from the requirements.txt. I think that should satisfy most of the need for this, but we can reopen if there is more to be done here. @bletham
网址:Linux安装fbprophet的一些错误和解决办法 https://www.yuejiaxmz.com/news/view/435074
相关内容
Android中 View not attached to window manager错误的解决办法从开发者角度入门Linux世界资料整理=Linux介绍+Ubuntu系统安装(视频+文字)
【Java报错已解决】Driver class ‘net.sourceforge.jtds.jdbc.Driver’ could not be found, make sure the
基于Linux的居民用电管理解决方案
Linux系统内存清理神器:Purge命令详解 – Linux命令大全(手册)
解决dateutil.parser.
关于技嘉主板使用win10操作系统关机自动重启的一种解决办法。其他厂家主板也可以尝试一下此方法。...
yum无法使用解决方法(比较全)
调试中的一些Python错误
小天鹅洗衣机e33故障,具体原因和解决办法