python中安装Scrapy模块依赖包汇总
作者:lon.y@qq.com
Scrapy的安装有一些依赖包,没有这些包是会安装失败的,下面我们就来详细探讨下
本地虚拟环境开发完成之后,上线过程中需要一一安装依赖包,做个记录如下:
CentOS 安装python3.5.3
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz tar -xf Python-3.5.3.tgz cd Python-3.5.3 ./configure --prefix=/usr/local/python353 make & make install
完成安装python3.5.3,在不删除系统自带的python2.x情况下,做几个软链:
#做python3软链 ln -s /usr/local/python353/bin/python3 /usr/local/bin/ #pip3软链 ln -s /usr/local/python353/bin/pip3 /usr/local/bin/
上传程序,安装scrapy及其依赖包:
#user agent包 pip3 install fake-useragent -i https://pypi.douban.com/simple/ #pymysql包 pip3 install pymysql -i https://pypi.douban.com/simple/ #PooledDB依赖包 pip3 install DBUtils -i https://pypi.douban.com/simple/ #PIL模块依赖包 pip3 install Image -i https://pypi.douban.com/simple/
在Centos系统中安装过程中,出现一个较为淡疼的问题:系统没有安装sqlite3,故此一直提示:
解决上面问题,下载sqlite3
sudo wget http://www.sqlite.org/2017/sqlite-autoconf-3190300.tar.gz
编译安装:
tar zxvf sqlite-autoconf-3190300.tar.gz cd sqlite-autoconf-3190300 ./configure --prefix=/usr/local/sqlite3 make && make install
重新编译Python,找到Python3.5.3的安装文件路径,编辑setup.py脚本,找到 “sqlite3”
sqlite_inc_paths = [ '/usr/include', '/usr/include/sqlite', '/usr/include/sqlite3', '/usr/local/include', '/usr/local/include/sqlite', '/usr/local/include/sqlite3', ]
在最后一行加入sqlite3编译安装路径,如下:
sqlite_inc_paths = [ '/usr/include', '/usr/include/sqlite', '/usr/include/sqlite3', '/usr/local/include', '/usr/local/include/sqlite', '/usr/local/include/sqlite3', '/usr/local/sqlite3', ]
重新编译Python3.5.3:
./configure --prefix=/usr/local/python353 make && make install
您可能感兴趣的文章:
- 在python3.9下如何安装scrapy的方法
- Python3环境安装Scrapy爬虫框架过程及常见错误
- 图文详解python安装Scrapy框架步骤
- 详解Python网络框架Django和Scrapy安装指南
- 详解Python安装scrapy的正确姿势
- mac下给python3安装requests库和scrapy库的实例
- Python之Scrapy爬虫框架安装及简单使用详解
- Python2.7下安装Scrapy框架步骤教程
- Python3安装Scrapy的方法步骤
- python安装Scrapy图文教程
- windows10系统中安装python3.x+scrapy教程
- 在Linux系统上安装Python的Scrapy框架的教程
- Python安装Scrapy库的常见报错解决