{"id":1926,"date":"2016-01-09T17:25:29","date_gmt":"2016-01-09T09:25:29","guid":{"rendered":"http:\/\/www.gigiwangs.com\/?p=1926"},"modified":"2016-01-09T17:25:29","modified_gmt":"2016-01-09T09:25:29","slug":"install-scrapy-on-osxmac-osx-%e4%b8%8a%e5%ae%89%e8%a3%85scrapysyngejoin-com","status":"publish","type":"post","link":"https:\/\/www.mujins.com\/?p=1926","title":{"rendered":"Install Scrapy on OSX|mac OSX \u4e0a\u5b89\u88c5Scrapy[SYN:gejoin.com]"},"content":{"rendered":"<p>\u6ce8\uff1a\u6587\u7ae0\u540c\u6b65\u81ea\u6211\u7684<a href=\"http:\/\/www.gejoin.com\/tech\/2016\/01\/08\/installing_scrapy_on_OSX.html\" target=\"_blank\">[SYN:gejoin.com]<\/a><\/p>\n<p>\u987a\u5229\u7684\u8bdd\uff0c\u4e00\u53e5\u547d\u4ee4\u641e\u5b9a\uff1a<br \/>\n<code>sudo pip install Scrapy<\/code><br \/>\nOSX\u8fd8\u662f\u9700\u8981\u989d\u5916\u4e00\u4e9b\u5305\u6216\u5347\u7ea7\u7684\uff0c\u5305\u62ec\uff1a<\/p>\n<p><code>cssselect, queuelib, six, w3lib, lxml, Twisted, characteristic, pyasn1, pyasn1-modules, service-identity<\/code><\/p>\n<p>\u5e78\u8fd0\u7684\u662fpip\u6216\u8005easy_install \u53ef\u4ee5\u81ea\u52a8\u4e3a\u4f60\u5b89\u88c5\uff0c\u4f46\u662f\u5176\u4e2d\u7684\u95ee\u9898\uff1a<\/p>\n<blockquote><p>Found existing installation: six 1.4.1<br \/>\nDEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.<br \/>\nUninstalling six-1.4.1:<\/p><\/blockquote>\n<p>\u2026<\/p>\n<blockquote><p>OSError: [Errno 1] Operation not permitted: \u2018\/tmp\/pip-qeBchm-uninstall\/System\/Library\/Frameworks\/Python.framework\/<br \/>\nVersions\/2.7\/Extras\/lib\/python\/six-1.4.1-py2.7.egg-info\u2019<\/p><\/blockquote>\n<p><a href=\"https:\/\/www.gigiwangs.com\/wp-content\/uploads\/2016\/01\/python.jpg\" data-lightbox=\"gal[1926]\" rel=\"attachment wp-att-1927\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1927\" src=\"https:\/\/www.gigiwangs.com\/wp-content\/uploads\/2016\/01\/python.jpg\" alt=\"python\" width=\"450\" height=\"350\" \/><\/a><\/p>\n<p>\u663e\u7136\u5347\u7ea7six\u662f\u51fa\u9519\u4e86,\u4f7f\u7528sudo<br \/>\n<code>pip install six --upgrade<\/code> \u6216\u8005 <code>pip uninstall six<\/code><br \/>\n\u90fd\u4f1a\u9047\u5230\u540c\u6837\u7684\u9519\u8bef\u3002\u65e0\u8bba\u4ec0\u4e48\u7528\u6237\uff0c\u591a\u5927\u6743\u9650\u3002\u60f3\u5fc5\u4e0b\u8f7d\u5305\u5b89\u88c5\u4e5f\u4f1a\u540c\u6837\u95ee\u9898\u3002\u6211\u53ea\u80fd\u8fd9\u4e48\u8ba4\u4e3a\uff1a\u8fd9\u90fd\u662fpip\u7684\u9519\u3002<br \/>\n\u597d\u5427\uff0c\u90a3\u5c31easy_install\u8bd5\u8bd5\u5427\u3002<\/p>\n<blockquote><p>sudo easy_install \u2013upgrade six<br \/>\nSearching for six<br \/>\nReading https:\/\/pypi.python.org\/simple\/six\/<br \/>\nBest match: six 1.10.0<br \/>\nDownloading https:\/\/pypi.python.org\/packages\/source\/s\/six\/&gt;six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55<br \/>\nProcessing six-1.10.0.tar.gz<\/p><\/blockquote>\n<blockquote><p>Installed \/Library\/Python\/2.7\/site-packages\/six-1.10.0-py2.7.egg<br \/>\nProcessing dependencies for six<br \/>\nFinished processing dependencies for six<\/p><\/blockquote>\n<p>\u7ee7\u7eed\u4f7f\u7528easy_install \u5b89\u88c5Scarpy\u5427:\u2026<\/p>\n<p><code>sudo easy_install Scrapy<\/code><\/p>\n<p>\u770b\u8d77\u6765\u633a\u987a\u5229..<br \/>\n\u53ef\u662f\u2026.<\/p>\n<blockquote><p>In file included from src\/lxml\/lxml.etree.c:323:<br \/>\nsrc\/lxml\/includes\/etree_defs.h:14:10: fatal error: \u2018libxml\/xmlversion.h\u2019 file not found<br \/>\n#include \u201clibxml\/xmlversion.h\u201d<br \/>\n^<br \/>\n1 error generated.<br \/>\nCompile failed: command \u2018cc\u2019 failed with exit status 1<br \/>\n\/tmp\/easy_install-U7v3Lb\/lxml-3.5.0\/temp\/xmlXPathInitxO27oS.c:1:10: &gt;fatal error: \u2018libxml\/xpath.h\u2019 file not found<br \/>\n#include \u201clibxml\/xpath.h\u201d<br \/>\n^<br \/>\n1 error generated.<\/p><\/blockquote>\n<p>\u770b\u6765libxml2 \u9700\u8981\u989d\u5916\u5b89\u88c5\u7684<\/p>\n<p><code>xcode-select --install<\/code><\/p>\n<p>\u4ee5\u4e0b\u5c31\u987a\u5229\u5b8c\u6210\u5b89\u88c5<\/p>\n<p><code>sudo pip install Scrapy<\/code><br \/>\nOR<br \/>\n<code>sudo pip easy_install Scrapy<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6ce8\uff1a\u6587\u7ae0\u540c\u6b65\u81ea\u6211\u7684[SYN:gejoin.com] \u987a\u5229\u7684\u8bdd\uff0c\u4e00\u53e5\u547d\u4ee4\u641e\u5b9a\uff1a sudo pip install Scrapy OSX\u8fd8\u662f\u9700\u8981\u989d\u5916\u4e00\u4e9b\u5305\u6216\u5347\u7ea7\u7684\uff0c\u5305\u62ec\uff1a cssselect, queuelib, six, w3lib, lxml, Twisted, characteristic, pyasn1, pyasn1-modules, service-identity \u5e78\u8fd0\u7684\u662fpip\u6216\u8005easy_install \u53ef\u4ee5\u81ea\u52a8\u4e3a\u4f60\u5b89\u88c5\uff0c\u4f46\u662f\u5176\u4e2d\u7684\u95ee\u9898\uff1a Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,25],"tags":[26],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts\/1926"}],"collection":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1926"}],"version-history":[{"count":0,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/wp\/v2\/posts\/1926\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mujins.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}