mac安装scrapy的坑

Homebrew
Homebrew是一款非常强大的可以应用在MAC中的Linux管理包,如果上面的方法感觉比较麻烦,我们可以通过下面的方法解决。
A – 执行安装brew
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
进入终端之后,执行brew的安装。
B – 安装 wget
brew install wget

C wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

D xcode-select —install

sudo pip install Scrapy -i https://pypi.douban.com/simple

错误参考

  1. OSError: [Errno 1] Operation not permitted:
    解决: 重新启动Mac OS
    重启时按住Command+R,进入Recovery模式
    在Recovery模式中输入:
    csrutil disable;
    重新启动,回到Mac OS

TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
解决:sudo pip install twisted==13.1.0

  1. OSError: [Errno 13] Permission denied 权限问题
    前面加sudo

命令

  1. sudo pip install Scrapy -i https://pypi.douban.com/simple 安装scrapy 指定源
  2. pip list //pip 已经装了的库
    已安装成功的库
    altgraph (0.10.2)
    asn1crypto (0.22.0)
    attrs (17.2.0)
    Automat (0.6.0)
    bdist-mpkg (0.5.0)
    bonjour-py (0.3)
    cffi (1.10.0)
    constantly (15.1.0)
    cryptography (1.9)
    cssselect (1.0.1)
    enum34 (1.1.6)
    execute (1.2)
    hyperlink (17.2.1)
    idna (2.5)
    incremental (17.5.0)
    ipaddress (1.0.18)
    lxml (3.8.0)
    macholib (1.5.1)
    matplotlib (1.3.1)
    modulegraph (0.10.4)
    numpy (1.13.0)
    parsel (1.2.0)
    pip (9.0.1)
    py2app (0.7.3)
    pyasn1 (0.2.3)
    pyasn1-modules (0.0.9)
    pycparser (2.17)
    PyDispatcher (2.0.5)
    pyobjc-core (2.5.1)
    pyobjc-framework-Accounts (2.5.1)
    pyobjc-framework-AddressBook (2.5.1)
    pyobjc-framework-AppleScriptKit (2.5.1)
    pyobjc-framework-AppleScriptObjC (2.5.1)
    pyobjc-framework-Automator (2.5.1)
    pyobjc-framework-CFNetwork (2.5.1)
    pyobjc-framework-Cocoa (2.5.1)
    pyobjc-framework-Collaboration (2.5.1)
    pyobjc-framework-CoreData (2.5.1)
    pyobjc-framework-CoreLocation (2.5.1)
    pyobjc-framework-CoreText (2.5.1)
    pyobjc-framework-DictionaryServices (2.5.1)
    pyobjc-framework-EventKit (2.5.1)
    pyobjc-framework-ExceptionHandling (2.5.1)
    pyobjc-framework-FSEvents (2.5.1)
    pyobjc-framework-InputMethodKit (2.5.1)
    pyobjc-framework-InstallerPlugins (2.5.1)
    pyobjc-framework-InstantMessage (2.5.1)
    pyobjc-framework-LatentSemanticMapping (2.5.1)
    pyobjc-framework-LaunchServices (2.5.1)
    pyobjc-framework-Message (2.5.1)
    pyobjc-framework-OpenDirectory (2.5.1)
    pyobjc-framework-PreferencePanes (2.5.1)
    pyobjc-framework-PubSub (2.5.1)
    pyobjc-framework-QTKit (2.5.1)
    pyobjc-framework-Quartz (2.5.1)
    pyobjc-framework-ScreenSaver (2.5.1)
    pyobjc-framework-ScriptingBridge (2.5.1)
    pyobjc-framework-SearchKit (2.5.1)
    pyobjc-framework-ServiceManagement (2.5.1)
    pyobjc-framework-Social (2.5.1)
    pyobjc-framework-SyncServices (2.5.1)
    pyobjc-framework-SystemConfiguration (2.5.1)
    pyobjc-framework-WebKit (2.5.1)
    pyOpenSSL (0.13.1)
    pyparsing (2.0.1)
    python-dateutil (1.5)
    pytz (2013.7)
    queuelib (1.4.2)
    scikit-learn (0.18.1)
    scipy (0.19.0)
    Scrapy (1.4.0)
    service-identity (17.0.0)
    setuptools (18.5)
    six (1.10.0)
    Twisted (13.1.0)
    virtualenv (15.1.0)
    w3lib (1.17.0)
    wheel (0.29.0)
    xattr (0.6.4)
    zope.interface (4.1.1)

me:~ apple$ scrapy
Scrapy 1.4.0 – no active project
运行 scrapy crawl quotes
哈哈

vim ~/.bash_profile
source ~/.bash_profile

    原文作者:心愿2016
    原文地址: https://www.jianshu.com/p/3c18a47faa98
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞