我是一个python新手,无法在我的mac os 10.10.15上安装scrapy。我安装了brew并能够设置virtualenv

时间:2017-08-14 03:43:38

标签: python python-3.x scrapy

我是一个python新手,无法在我的mac os 10.10.15上安装scrapy。我安装了brew并能够设置virtualenv。

(scrapdata) 
----------
$ pip3 install scrapy
Collecting scrapy
  Using cached Scrapy-1.4.0-py2.py3-none-any.whl
Collecting pyOpenSSL (from scrapy)
  Using cached pyOpenSSL-17.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:748) -- 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:748) -- 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/qt/0m1c18vs4wj_xwmw40m92v7w0000gn/T/pip-build-x9273g0d/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 "/User/UserName/scrapdata/lib/python3.6/site-packages/setuptools/dist.py", line 325, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/Users/UserName/scrapdata/lib/python3.6/site-packages/setuptools/dist.py", line 446, in fetch_build_eggs
        replace_conflicting=True,
      File "/Users/UserName/scrapdata/lib/python3.6/site-packages/pkg_resources/__init__.py", line 855, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/Users/UserName/scrapdata/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1127, in best_match
        return self.obtain(req, installer)
      File "/Users/UserName/scrapdata/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1139, in obtain
        return installer(requirement)
      File "/Users/UserName/scrapdata/lib/python3.6/site-packages/setuptools/dist.py", line 518, in fetch_build_egg
        return cmd.easy_install(req)
      File "/Users/UserName/scrapdata/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/qt/0m1c18vs4wj_xwmw40m92v7w0000gn/T/pip-build-x9273g0d/Twisted/

我已粘贴输出。 还尝试安装setuptools,unroll和easy_setup但没有任何效果。  请帮忙。谢谢!

1 个答案:

答案 0 :(得分:0)

您是否尝试过以下操作?

  • 删除并重新创建您的virtualenv?
  • 使用--no-cache-dir
  • 中的pip选项
  • 如果这不起作用,请移除位于~/Library/Caches/pip的缓存,然后重试?

我刚刚使用pyenv进行了测试(强烈推荐),它的工作没有任何问题,我也在macOS Sierra上。祝你好运!

编辑#1:当我想到这一点时,你的错误中给出了整个SSL字符串,你可能会有一些古怪的Python / MacOS事情。看一下这个SO帖子,因为它与你正在经历的非常相似==&gt; "SSL certificate verify failed" using pip to install packages