Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在OS X上的virtualenv中安装scrapy加密时出错_Python_Macos_Cryptography_Scrapy_Cc - Fatal编程技术网

Python 在OS X上的virtualenv中安装scrapy加密时出错

Python 在OS X上的virtualenv中安装scrapy加密时出错,python,macos,cryptography,scrapy,cc,Python,Macos,Cryptography,Scrapy,Cc,我在OSX10.11上的virtualenv中用pip安装了scrapy。在安装加密技术时,它说: building '_openssl' extension cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstric

我在
OSX10.11
上的
virtualenv
中用
pip
安装了scrapy。在安装加密技术时,它说:

building '_openssl' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c build/temp.macosx-10.11-intel-2.7/_openssl.c -o build/temp.macosx-10.11-intel-2.7/build/temp.macosx-10.11-intel-2.7/_openssl.o
build/temp.macosx-10.11-intel-2.7/_openssl.c:423:10: fatal error: 'openssl/e_os2.h' file not found
#include <openssl/e_os2.h>
     ^
1 error generated.
error: command 'cc' failed with exit status 1
有什么建议可以帮我解决吗?
顺便说一句,当我在安装
scrapy
时没有安装
virtualenv
,一切都很顺利

pip install --upgrade pip

可能会有帮助

嗯,您确定安装了所有依赖项(特别是与SSL相关的依赖项)吗?如果您运行的是homebrew,brew安装openssl和env LDFLAGS=“-L$(brew--前缀openssl)/lib”CFLAGS=“-I$(brew--前缀openssl)/include”pip安装加密-另请参阅下一行也适用于我:
brew安装openssl和&brew链接openssl--force
@madzohan它可以工作。
pip install --upgrade pip