今儿想要试试用python跑Prophet模型,pip之后发现和其他的安装方法不太一样,于是便开启了一系列的配环境,改bug之旅。。。。。
一、针对pip3 install fbprophet
之后报错,如下:
解决方法:
1、打开terminal
2、添加系统的环境变量,使用 vi ~/.bash_profile 打开环境变量,使用i,进入编辑状态,将下面语句插入进去:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
3、点击esc,输入wq!,保存
4、输入source ~/.bash_profile ,更新文件
之后再次pip3 install fbprophet
又报错如下:
解决方法:
输入:pip3 install convertdate
至此终于安装成功。
- 记fbprophet的系列依赖包:
Requirement already satisfied: fbprophet in /anaconda3/lib/python3.7/site-packages (0.6)
Requirement already satisfied: Cython>=0.22 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (0.29.2)
Requirement already satisfied: cmdstanpy==0.4 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (0.4.0)
Requirement already satisfied: pystan>=2.14 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (2.19.1.1)
Requirement already satisfied: numpy>=1.10.0 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (1.15.3)
Requirement already satisfied: pandas>=0.23.4 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (0.23.4)
Requirement already satisfied: matplotlib>=2.0.0 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (3.0.2)
Requirement already satisfied: LunarCalendar>=0.0.9 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (0.0.9)
Requirement already satisfied: convertdate>=2.1.2 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (2.2.0)
Requirement already satisfied: holidays>=0.9.5 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (0.10.2)
Requirement already satisfied: setuptools-git>=1.2 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (1.2)
Requirement already satisfied: python-dateutil>=2.8.0 in /anaconda3/lib/python3.7/site-packages (from fbprophet) (2.8.1)
Requirement already satisfied: pytz>=2011k in /anaconda3/lib/python3.7/site-packages (from pandas>=0.23.4->fbprophet) (2018.7)
Requirement already satisfied: cycler>=0.10 in /anaconda3/lib/python3.7/site-packages (from matplotlib>=2.0.0->fbprophet) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /anaconda3/lib/python3.7/site-packages (from matplotlib>=2.0.0->fbprophet) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /anaconda3/lib/python3.7/site-packages (from matplotlib>=2.0.0->fbprophet) (2.3.0)
Requirement already satisfied: ephem>=3.7.5.3 in /anaconda3/lib/python3.7/site-packages (from LunarCalendar>=0.0.9->fbprophet) (3.7.7.1)
Requirement already satisfied: pymeeus<=1,>=0.3.6 in /anaconda3/lib/python3.7/site-packages (from convertdate>=2.1.2->fbprophet) (0.3.7)
Requirement already satisfied: six in /anaconda3/lib/python3.7/site-packages (from holidays>=0.9.5->fbprophet) (1.11.0)
Requirement already satisfied: korean-lunar-calendar in /anaconda3/lib/python3.7/site-packages (from holidays>=0.9.5->fbprophet) (0.2.1)
Requirement already satisfied: setuptools in /anaconda3/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->fbprophet) (40.6.3)
二、在配环境过程中,可能是哪儿手滑,导致在每次打开terminal后都会出现两句报错
line 15: unexpected EOF while looking for matching `"'
line 23: syntax error: unexpected end of file
解决方法:
1、找到第15行或其以上的行出现 PATH=" "的地方。检查引号配对儿,并修改
2、按下enter键。
3、保存,退出.profile文件。
4、再次输入 source ~/.profile
至此,不再报错。
三、为了写php作业,按照老师要求安装netbeans,由于又是和老师系统不一样,只能自己去找mac版的,去官网下了11.x 版的,代码运行不起来,装了卸载装了卸载搞了三遍,未果。于是又找了一个8.x 版的,安装完软件就死翘翘,打不开,气的只能去活动监视器强行退出。搞了好久,最终决定换软件,先从电脑上已安装过的软件入手,都说vscode万能,那就它吧!按照百度的教程给它配了个php环境,代码倒是能运行了,可是浏览器调不出来。。。。最后又是以没搞出来结束。。。换sublime,查了一下,也能配环境,不过笨到极点的我又是没配成功。。。
最后,去查了一下,原来有专门写php的工具!激动!看到phpstorm果断下载!。。。不过安装完之后一跑代码就会出现,502 Bad Gateway。。报错说是解释器的问题,于是接着开启了配置解释器的过程。
按照教程都说,由于mac电脑自带php环境,但是又不能用自带的,只能自己配置。
需要下载xampp,之后在解析器配置环境变量添加路径的时候,不能选择phpstorm.exe,要选择xampp所在路径,默认为/usr/local/php5/bin
,至此就能运行啦!
另:phpstorm2020激活码如下:
QYYBAC9D3J-eyJsaWNlbnNlSWQiOiJRWVlCQUM5RDNKIiwibGljZW5zZWVOYW1lIjoi6LaF57qnIOeoi+W6j+WRmCIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiIiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwiZmFsbGJhY2tEYXRlIjoiMjAyMC0wMS0wNCIsInBhaWRVcFRvIjoiMjAyMS0wMS0wMyJ9LHsiY29kZSI6IkFDIiwiZmFsbGJhY2tEYXRlIjoiMjAyMC0wMS0wNCIsInBhaWRVcFRvIjoiMjAyMS0wMS0wMyJ9LHsiY29kZSI6IkRQTiIsImZhbGxiYWNrRGF0ZSI6IjIwMjAtMDEtMDQiLCJwYWlkVXBUbyI6IjIwMjEtMDEtMDMifSx7ImNvZGUiOiJQUyIsImZhbGxiYWNrRGF0ZSI6IjIwMjAtMDEtMDQiLCJwYWlkVXBUbyI6IjIwMjEtMDEtMDMifSx7ImNvZGUiOiJHTyIsImZhbGxiYWNrRGF0ZSI6IjIwMjAtMDEtMDQiLCJwYWlkVXBUbyI6IjIwMjEtMDEtMDMifSx7ImNvZGUiOiJETSIsImZhbGxiYWNrRGF0ZSI6IjIwMjAtMDEtMDQiLCJwYWlkVXBUbyI6IjIwMjEtMDEtMDMifSx7ImNvZGUiOiJDTCIsImZhbGxi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EwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYDVR0PBAQDAgWgMA0GCSqGSIb3DQEBCwUAA4ICAQAF8uc+YJOHHwOFcPzmbjcxNDuGoOUIP+2h1R75Lecswb7ru2LWWSUMtXVKQzChLNPn/72W0k+oI056tgiwuG7M49LXp4zQVlQnFmWU1wwGvVhq5R63Rpjx1zjGUhcXgayu7+9zMUW596Lbomsg8qVve6euqsrFicYkIIuUu4zYPndJwfe0YkS5nY72SHnNdbPhEnN8wcB2Kz+OIG0lih3yz5EqFhld03bGp222ZQCIghCTVL6QBNadGsiN/lWLl4JdR3lJkZzlpFdiHijoVRdWeSWqM4y0t23c92HXKrgppoSV18XMxrWVdoSM3nuMHwxGhFyde05OdDtLpCv+jlWf5REAHHA201pAU6bJSZINyHDUTB+Beo28rRXSwSh3OUIvYwKNVeoBY+KwOJ7WnuTCUq1meE6GkKc4D/cXmgpOyW/1SmBz3XjVIi/zprZ0zf3qH5mkphtg6ksjKgKjmx1cXfZAAX6wcDBNaCL+Ortep1Dh8xDUbqbBVNBL4jbiL3i3xsfNiyJgaZ5sX7i8tmStEpLbPwvHcByuf59qJhV/bZOl8KqJBETCDJcY6O2aqhTUy+9x93ThKs1GKrRPePrWPluud7ttlgtRveit/pcBrnQcXOl1rHq7ByB8CFAxNotRUYL9IF5n3wJOgkPojMy6jetQA5Ogc8Sm7RG6vg1yow==
好的。。。接着去研究Prophet模型了。。。不知道后续又会有什么bug出现。。。o(╥﹏╥)o