OSX El Capitan python安装加密失败



我试过

sudo pip安装加密

错误消息是

收集加密使用缓存的密码1.3.2-cp27-none-macosx_10_6_intel.whl已满足要求(使用--upgrade-to-upgrade):在/Library/Python/2.7/site-packages中cffi>=1.4.1(来自密码学)已满足要求(使用--upgrade-to-upgrade):pyasn1>=0.1.8 in/Library/Python/2.7/site-packages(来自密码学)收集setuptools>=11.3(来自加密)使用缓存的安装工具-21.0.0-py2.py3-none-any.whl已满足要求(使用-升级到升级):在/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python中有六个>=1.4.1(来自密码学)已满足要求(使用--upgrade-to-upgrade):idna>=2.0 in/Library/Python/2.7/site-packages(来自密码学)已满足要求(使用--upgrade-to-upgrade):/Library/Python/2.7/site-packages中的ipaddress(来自密码学)已满足要求(使用--upgrade to upgrade):/Library/Python/2.7/site-packages中的enum34(来自密码学)已满足要求(使用--upgrade-to-upgrade):/Library/Python/2.7/site-packages中的pycparser(来自cffi>=1.4.1->cryptography)安装收集的程序包:setuptools、加密已找到现有安装:setuptools 1.1.6正在卸载setuptools-1.1.6:异常:追踪(最近一次通话):文件"/Library/Python/2.7/site packages/pip/basecommand.py",第215行,在main中status=self.run(选项,args)文件"/Library/Python/2.7/site packages/pip/commands/install.py",第317行,正在运行prefix=选项.prefix_path,文件"/Library/Python/2.7/site packages/pip/req/req_set.py",第736行,安装中requirement.uninstall(auto_confirm=True)文件"/Library/Python/2.7/site packages/pip/req/req_install.py",第742行,在卸载中paths_to_remove.remove(auto_confirm)文件"/Library/Python/2.7/site packages/pip/req/req_uninstall.py",第115行,在remove中重命名(路径,new_path)重命名中的文件"/Library/Python/2.7/site packages/pip/utils/init.py",第267行shutil.move(旧、新)文件"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",第299行,正在移动中复制树(src,real_dst,symlinks=True)文件"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",第208行,在复制树中引发错误,个错误错误:[('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.py','/tmp/pip-p7Ywro-uninstall/System/Lebrary/Frameworks/Python.framework/Vversions/2.7/Extras/lib/Python//markerlib/init.my',"[Erno 1]不允许操作:'/tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.py'"),('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.pyc','/tmp/pip-p7Ywro-uninstall/System/Lebrary/Frameworks/Python.framework/Vversions/2.7/Extras/lib/Python//markerlib/init.pyc'不允许的操作:'/tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlb/init.pyc'"),('/System/Library/Frameworks/Versions/2.7/Extras/lb/Python__markerlin/marks.py','/tmp-pip-p7Y wro-unistall/System/Lbrary/FFrameworks/Python.framework/Versions/2.7/Eextras/lib/Python/markerlb/marks.py],"[Erno 1]不允许的操作:'/tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlb/marks.py'"),('/System/Library/Frameworks/Pyth.framework/Versions/2.7/Eextras/lib/Python/markerlb/markers.pyc','/tmp/pap-p7Ywro-uninstall/System/Library/Frameworks/spython.framework/Versions+2.7/Extrus/lib/Python _markerlin/marks.pyc],"[Erno 1]不允许的操作:'/tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlb/marks.pyc'"),('/System/Library/Frameworks/Pyth.framework/Versions/2.7/Eextras/lib/Python/markerlb','/tmp/pip-p7Ywro-uninstall/Seystem/Libraly/Frameworks/spython.framework/Versions/1.7/Extrus/lib/pyon/markerlib',"[Erno 1]不允许的操作:"/tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib")]

然后我搜索了一些帖子并尝试了

brew安装pkg配置libffi openssl

警告:pkg-config-0.28已安装警告:libffi-3.0.13已安装警告:openssl-1.0.2d_1已安装

CFLAGS="-I/usr/local/opt/openssl/include"sudo pip安装加密==0.8

我收到这个错误消息:

src/cryptography/hazmat/bindings/pycache/\cryptography_cffi_f3e4673fx399b1113.c:217:10:致命错误:找不到'openssl/aes.h'文件#包括^生成1个错误。错误:命令"cc"失败,退出状态为1


命令"/usr/bin/python-u-c"导入setuptools,标记化文件='/private/tmp/pip-build-MxT6op/加密/setup.py';exec(compile(getattr(tokenize,'open',open)(file).read().replace('\r\n','\n'),file,'exec'))"install--record/tmp/pip-G6b8Y_-record/install-record.txt--外部管理的单一版本--compile"失败,/private/tmp/pip-build-MxT6op/cryptorylogy/中的错误代码为1

我也试过

brew安装pkg配置libffi openssl

env LDFLAGS="-L$(brew--前缀openssl)/lib"CFLAGS="-I$(brew---前缀openssl)/include"pip安装加密

得到了这个

找到现有安装:setuptools1.1.6正在卸载setuptools-1.1.6:异常:追踪(最近一次通话):文件"/Library/Python/2.7/site packages/pip/basecommand.py",第215行,在main中status=self.run(选项,args)文件"/Library/Python/2.7/site packages/pip/commands/install.py",第317行,正在运行prefix=选项.prefix_path,文件"/Library/Python/2.7/site packages/pip/req/req_set.py",第736行,安装中requirement.uninstall(auto_confirm=True)文件"/Library/Python/2.7/site packages/pip/req/req_install.py",第742行,在卸载中paths_to_remove.remove(auto_confirm)文件"/Library/Python/2.7/site packages/pip/req/req_uninstall.py",第115行,在remove中重命名(路径,new_path)重命名中的文件"/Library/Python/2.7/site packages/pip/utils/init.py",第267行shutil.move(旧、新)文件"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",第299行,正在移动中复制树(src,real_dst,symlinks=True)文件"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",第208行,在复制树中引发错误,个错误错误:[('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.py','/tmp/pip aYpqDT uninstall/System/Lebrary/Frameworks/Python.framework/Vversions/2.7/Extras/lib/Python//markerlib/init.my',"[Erno 1]不允许的操作:'/tmp/pip aYpqDT uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.py'"),('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.pyc','/tmp/pip aYpqDT uninstall/System/Lebrary/Frameworks/Python.framework/Visions/2.7/Extras/lib/Python//markerlib/init.pyc'不允许的操作:'/tmp/pip aYpqDT uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib/init.pyc'"),('/System/LLibrary/Frameworks/Pyth.framework/Versions/2.7/Eextras/lib/Python/_maarkerlib/markerlib.py','/tmp/pip aYpq DT uninstall/Seystem/Librass/Frameworks/Python.framework/Versions/2.7/Extras/lb/Python/_markerlb/marks.py',"[Erno 1]不允许的操作:'/tmp/pip aYpqDT uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlb/marks.py'"),('/System/Library/Frameworks/Pyth.framework/Versions/2.7/Eextras/lib/Python/markerlb/markers.pyc','/tmp/paip aYqDT unistall/System/Lbrary/FFrameworks/Python.framework/Versions/2.7/Extras/lb/Python/makerrelb/marks.pyc',"[Erno 1]不允许的操作:'/tmp/pip aYpqDT uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlb/marks.pyc'"),('/System/Lebrary/Frameworks/Python.framework/Vversions/2.7/Extras/lib/Python//markerlb','/tmp/pip aYpq DT uninstall/Seystem/Librals/Frameworks/Python.framework/Versions/2.7/Eextras/lib/Python/markerlib',"[Erno 1]不允许的操作:"/tmp/pip aYpqDT uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/_markerlib")]

请帮我解决这个问题。非常感谢。

对我有效的是:

sudo brew reinstall python

我通过以下命令得到了这个修复:

brew reinstall python
ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" 
CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography
brew link —force openssl

在Mac OS El Capitan上安装加密软件包。如加密安装文档中所述

env LDFLAGS="-L$(brew--前缀openssl)/lib"CFLAGS="-I$(brew---前缀openssl)/include"pip安装加密

最新更新