在Mac OSX 10.9.5上安装Scrapy [英] Installing Scrapy on Mac OSX 10.9.5

查看:108
本文介绍了在Mac OSX 10.9.5上安装Scrapy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是python的新手,安装了scrapy后碰壁了.

I've new to python and have hit a wall with installing scrapy.

环境详细信息:

MacBook Pro

MacBook pro

OSX 10.9.5

OSX 10.9.5

已安装XCode和命令行实用程序

XCode and Command Line utilities are installed

Python 2.7.9安装在/usr/local/bin/python

Python 2.7.9 is installed in /usr/local/bin/python

Python 2.7.5(作为OSX的一部分)已安装在/usr/bin/python

Python 2.7.5 (distrib as part of OSX) is installed in /usr/bin/python

使用pip安装

方法尝试进行约会

无法尝试进行初始安装(在添加python 2.7.9之前),因为在2.7.5默认安装中不存在pip.由于违反安全性,尝试添加pip失败,因此我添加了2.7.9安装.

Initial attempt to install (before adding the python 2.7.9) was impossible as pip was not present in the 2.7.5 default installation. Trying to add pip failed due to security violations, so I added the 2.7.9 installation.

然后我可以运行pip,但是由于缺少libxml而导致致命错误(在其他线程中报告),并遇到了问题,可通过添加命令行工具来解决该问题.

I could then run pip, but hit problems with the fatal error (reported in other threads) due to libxml being missing, which was resolved by adding the command line tools.

然后安装进一步进行,但失败并显示以下错误:

The installation then ran further, but fails with the following error:

/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_464d07d2xdb61d8fa.c -o build/temp.macosx-10.6-intel-2.7/src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_464d07d2xdb61d8fa.o

src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_464d07d2xdb61d8fa.c:218:10: fatal error: 'CommonCrypto/CommonKeyDerivation.h' file not found

#include <CommonCrypto/CommonKeyDerivation.h>

         ^

1 error generated.

error: command '/usr/bin/clang' failed with exit status 1

自遇到此错误以来,我尝试了多种方法:

Since hitting this error I have tried multiple approaches:

  • 卸载scrapy,然后手动安装加密-加密安装失败,并出现相同的错误
  • 卸载scrapy并使用pip命令行选项== 0.22重新安装以安装先前版本-安装失败,并出现相同错误
  • 使用pip命令行选项--user安装到本地用户目录-安装失败,出现相同错误

据我从搜索中得知,尚未在Stackoverflow或Github上报告此问题.如何克服此问题以成功安装scrapy? 谢谢

As far as I can tell from searching, this issue has not been reported on Stackoverflow or Github. How can I get over this issue to successfully install scrapy? Thanks

推荐答案

我设法通过环岛的方式解决了这个问题,我将其分享为自己的问题的答案.

I managed to resolve this myself by a roundabout means, which I'm sharing as an answer to my own question.

我从来没有通过pip安装密码.我通过安装anaconda解决了这个问题.密码术通过蟒蛇安装得很好.然后,我成功地通过pip install成功安装了scrapy,它可以识别出已经存在加密技术.

I never got cryptography to install through pip. I got around this by installing anaconda. Cryptography installed fine through anaconda. I then successfully installed scrapy with pip install which recognized that cryptography was already present.

这篇关于在Mac OSX 10.9.5上安装Scrapy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆