06 windows安装Python+Pycharm+Scrapy环境

时间:2023-03-08 17:04:16

windows安装Python+Pycharm+Scrapy环境

使用微信扫码关注微信公众号,并回复:“Python工具包”,免费获取下载链接!

06 windows安装Python+Pycharm+Scrapy环境

一、卸载python环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

卸载以下软件:

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

二、安装python环境

(1) 安装python开发环境3.6.4,双击运行“python-3.6.4-amd64.exe”

06 windows安装Python+Pycharm+Scrapy环境

在C盘创建python文件夹,在python文件夹里面创建python_venv文件夹

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

输入“win+r”,输入cmd,,检查python是否安装成功,是否成功配置环境变量,出现下面情况,表示安装成功。

06 windows安装Python+Pycharm+Scrapy环境

(2)安装python开发工具pycharm双击运行“pycharm-community-2017.3.3.exe”

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

以下在pycharm中配置开发环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

此时,环境已经统一了

三、安装urllib和bs4

(1)在cmd下面输入:“pip install urllib3”

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

(2) 在cmd下面输入:“pip install lxml”

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

(3)在cmd中输入:“pip install bs4”

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

(4)查看以上模块是否成功安装

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

四、安装scrapy框架

(1)在cmd下输入“pip install scrapy”,会出现如下错误:

06 windows安装Python+Pycharm+Scrapy环境

(2) 运行 “python -m pip install --upgrade pip”

06 windows安装Python+Pycharm+Scrapy环境

(3)运行“pip install twisted”

字面意思看需要安装Microsoft Visual C++ 14.0 ,但是这个东西安装起来很麻烦,而且安装上了也不一定准确,这个时候呢,我们一般就考虑第三方的python模块安装包

https://www.lfd.uci.edu/~gohlke/pythonlibs/

查找:“twisted”,找到对应的版本,进行下载

06 windows安装Python+Pycharm+Scrapy环境

(4) 然后用命令行到whl的目录

“pip install Twisted-18.7.0-cp36-cp36m-win_amd64

06 windows安装Python+Pycharm+Scrapy环境

(4)再执行“pip install scrapy”,就会安装成功

06 windows安装Python+Pycharm+Scrapy环境

(5)在cmd下输入“scrapy
--version”,测试,scrapy是否安装成功,出现下图所示,代表了安装成功

06 windows安装Python+Pycharm+Scrapy环境

06 windows安装Python+Pycharm+Scrapy环境

(6)在运行“scrapy crawl xxx”时,会报错:

06 windows安装Python+Pycharm+Scrapy环境

执行“pip install pypiwin32”

06 windows安装Python+Pycharm+Scrapy环境

 此时Scrapy环境已经搭建完成!

 五、下载Python工具包

使用微信扫码关注微信公众号,并回复:“Python工具包”,免费获取下载链接!

06 windows安装Python+Pycharm+Scrapy环境