我是在自己的vps(centos7)上部署的,使用了virtualenv,使用的python版本为3.5.2
注意编译环境一定要装好。
关于centos7安装python3.5,启用virtualenv以及必须的编译环境,请看这里
部署
# 新建虚拟环境并进入
>>>virtualenv -p /usr/bin/python3 ~/envs/testenv
>>>source ~/envs/testenv/bin/activate
# 安装pycurl(安装pyspider时就会自动安装,但是自动安装的在我这儿出错)
>>>export PYCURL_SSL_LIBRARY=nss
>>>pip install pycurl --no-cache-dir
# 安装pyspider
>>>pip install pyspider
# 执行
pyspider
遇到的问题
pip install pyspider 执行后提示curl安装不上
是因为编译环境没有装好,yum安装libcurl-devel即可
安装好pyspider成功,运行pyspider命令时报错
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either run this under Python 2<