MAC 安装Scrapy

来源:互联网 发布:手机土方计算软件 编辑:程序博客网 时间:2024/06/01 08:28

现状

自带python2.7 ,又安装了python3.6,可以使用pip3,而pip不能使用


安装

使用 pip3 install Scrapy

Collecting Scrapy

  Using cached Scrapy-1.4.0-py2.py3-none-any.whl

Collecting cssselect>=0.9 (from Scrapy)

  Using cached cssselect-1.0.1-py2.py3-none-any.whl

Collecting pyOpenSSL (from Scrapy)

  Using cached pyOpenSSL-17.2.0-py2.py3-none-any.whl

Collecting parsel>=1.1 (from Scrapy)

  Using cached parsel-1.2.0-py2.py3-none-any.whl

Collecting Twisted>=13.1.0 (from Scrapy)

  Using cached Twisted-17.5.0.tar.bz2

    Complete output from command python setup.py egg_info:

    Download error on https://pypi.python.org/simple/incremental/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found!

    Couldn't find index page for 'incremental' (maybe misspelled?)

    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found!

    No local packages or working download links found for incremental>=16.10.1

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/private/var/folders/fz/sm6sqf4n6dd4cbcx7n21l8_r0000gn/T/pip-build-j3t4ahxs/Twisted/setup.py", line 21, in <module>

        setuptools.setup(**_setup["getSetupArgs"]())

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup

        _setup_distribution = dist = klass(attrs)

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 336, in __init__

        self.fetch_build_eggs(attrs['setup_requires'])

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 419, in fetch_build_eggs

        replace_conflicting=True,

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 854, in resolve

        dist = best[req.key] = env.best_match(req, ws, installer)

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1126, in best_match

        return self.obtain(req, installer)

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1138, in obtain

        return installer(requirement)

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py", line 491, in fetch_build_egg

        return cmd.easy_install(req)

      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 666, in easy_install

        raise DistutilsError(msg)

    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1')

    

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/fz/sm6sqf4n6dd4cbcx7n21l8_r0000gn/T/pip-build-j3t4ahxs/Twisted/


然后查红色的部分报错,均为解决

往上看,发现certificate verify failed

于是安装证书: pip3 install certif

再次安装Scrapy后,成功。。。

当然在查找红色部分错误时,安装了好多库,不知道对最后的结果有什么影响。。。