windows 上安装 pip 和 scrapy

来源:互联网 发布:两人换脸的相机软件 编辑:程序博客网 时间:2024/05/16 04:54

scrapy 有版本限制 python2.7

1 安装python

     [python下载](https://www.python.org/downloads/)    下载之后点击安装即可    设置环境变量 将python.exe路径加入到PATH即可

2 安装pip

方法一:

    [pip下载](https://bootstrap.pypa.io/get-pip.py)    安装    python get-pip.py

方法二:

方法一会可能会遇到 安装的时候 read time out可以采用下载 pip-9.0.1.tar.gz https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9解压执行python setup.py install

3 安装scrapy

python -m pip install scrapy

在最后一步经常会遇到这样的问题

raise ReadTimeoutError(self._pool, None, 'Read timed out.')ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read ti                                                      med out.

解决方法可以利用国内的源进行下载

python -m pip install --index https://pypi.mirrors.ustc.edu.cn/simple/  scrapy
镜像源阿里云 速度最快 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/豆瓣(douban) http://pypi.douban.com/simple/Python官方 https://pypi.python.org/simple/v2ex http://pypi.v2ex.com/simple/中国科学院 http://pypi.mirrors.opencas.cn/simple/清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
0 0