最初在notebook中想运行这样一段代码
from fbprophet import Prophet
但是遇到了非常多错误(最后是使用的conda下载的fbprophet 包,不清楚我前面升级的pip到底有没有帮助,可以直接从pystan库开始尝试)
首先,pip版本需要是最新版20.3.1
在线更新pip
python -m pip install --upgrade pip
强制升级是,python -m pip install -U --force-reinstall pip
如果是把pip卸载,pip uninstall pip
pip再次安装:
离线下载pip安装包:
在这个链接里下载.gz形式的安装包,https://pypi.org/project/pip/#files
下载完成后解压,解压后有个setup.py文件,在命令行里进入这个文件所在的文件夹,然后执行这个文件,python setup.py install
如果下载的是.whl文件版本,安装方式也是在当前目录下运行 :pip install xxx.whl
在线安装:pip install xx
如果网络不好可以使用国内镜像,pip install xx -i http://xxx
国内的几个常用镜像地址:
豆瓣 : https://pypi.douban.com/simple
中国科学科技大学 : https://mirrors.ustc.edu.cn/pypi/web/simple/
清华大学 :https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/
遇到的错误:
错误:
no module named pip._internal.cli.ma
解决办法:
重装pip
如果wheel报错
pip install wheel
错误:
failed building wheel for fbprophet
解决办法:
这个库依赖于pystan库,必须先安装pystan
pip install pystan
(我没有创建虚拟环境,也没有给pystan装c++环境)
我看有个博主使用conda安装fbprophet成功了,我也就这么装的,成功
conda install fbprophet -c conda-forge
如果有下载一堆看起来不相干的包,那就是成功的界面
使用conda的时候可能会遇到以下错误
错误:
An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way.
原因是conda源加入了不知名的URL,现在不能使用了(或者废弃)
解决办法:
添加清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
第一次试着在notebook里调用的时候报了错
ERROR:
fbprophet:Importing plotly failed. Interactive plots will not work.
解决方法:
conda install plotly -y
第二次试着调用就成功了,成功界面
pyGUI的安装地址
https://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/