OSX El Capitan python安装加密失败

时间:2016-05-18 11:52:07

标签: python macos

我试过

sudo pip install cryptography

错误信息是

  

收集密码学    使用缓存加密 - 1.3.2-cp27-none-macosx_10_6_intel.whl   要求已经满足(使用--upgrade升级):cibi> = 1.4.1 in /Library/Python/2.7/site-packages(来自加密)   要求已经满足(使用--upgrade升级):pyln1> = 0.1.8 in /Library/Python/2.7/site-packages(来自加密)   收集setuptools> = 11.3(来自加密)     使用缓存的setuptools-21.0.0-py2.py3-none-any.whl   要求已经满足(使用--upgrade升级):/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python(来自加密)中的六个> = 1.4.1   要求已经满足(使用--upgrade升级):/ library /Python/2.7/site-packages中的idna> = 2.0(来自加密)   要求已经满足(使用--upgrade升级):ipaddress in /Library/Python/2.7/site-packages(来自加密)   要求已经满足(使用--upgrade升级):/ library /Python/2.7/site-packages中的enum34(来自加密)   要求已经满足(使用--upgrade升级):pLparser在/Library/Python/2.7/site-packages(来自cffi> = 1.4.1->加密)   安装收集的软件包:setuptools,加密     找到现有安装:setuptools 1.1.6       卸载setuptools-1.1.6:   例外:   Traceback(最近一次调用最后一次):     文件" /Library/Python/2.7/site-packages/pip/basecommand.py" ;,第215行,主要       status = self.run(options,args)     文件" /Library/Python/2.7/site-packages/pip/commands/install.py" ;,第317行,在运行中       PREFIX = options.prefix_path,     File" /Library/Python/2.7/site-packages/pip/req/req_set.py" ;,第736行,安装中       requirement.uninstall(auto_confirm =真)     文件" /Library/Python/2.7/site-packages/pip/req/req_install.py" ;,第742行,在卸载中       paths_to_remove.remove(auto_confirm)     File" /Library/Python/2.7/site-packages/pip/req/req_uninstall.py" ;,第115行,删除       重命名(path,new_path)     文件" /Library/Python/2.7/site-packages/pip/utils/ init .py",第267行,重命名       shutil.move(旧的,新的)     File" /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py" ;,第299行,移动       copytree(src,real_dst,symlinks = True)     文件" /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py" ;,第208行,在copytree中       提出错误,错误   错误:[(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .py',' / tmp / pip-p7Ywro-uninstall / System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .py'," [Errno 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&#39 ;,' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc' ," [Errno 1]不允许操作:' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc'"),(' /System/Library/Frameworks/Python.framework/Versions/2.7/ Extras / lib / python / _markerlib / markers.py',' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ markers.py'," [Errno 1]不允许操作:' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/ python / _markerlib / markers.py'"),(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc' ,' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'," [Errno 1 ]不允许操作:' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'" ),(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib' ;,' / tmp / pip-p7Ywro-uninstall / System / Library /框架/ Python.framework /版本/ 2.7 /附加/ LIB /蟒/ _markerlib' ," [Errno 1]不允许操作:' /tmp/pip-p7Ywro-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib' &#34)]

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

brew install pkg-config libffi openssl

  

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

CFLAGS =" -I / USR /本地的/ opt / OpenSSL的/包括" sudo pip install cryptography == 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,tokenize; 文件 =' / private / tmp / pip-build-MxT6op /cryptography/setup.py';exec(compile(getattr(tokenize,' open',open)( file )。read()。replace(' \ r \ n',' \ n'),文件,' exec'))" install --record /tmp/pip-G6b8Y_-record/install-record.txt --single-version-external-managed --compile"在/ private / tmp / pip-build-MxT6op / cryptography /

中出现错误代码1失败

我也试过

brew install pkg-config libffi openssl

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

并得到了这个

  

找到现有安装:setuptools 1.1.6       卸载setuptools-1.1.6:   例外:   Traceback(最近一次调用最后一次):     文件" /Library/Python/2.7/site-packages/pip/basecommand.py" ;,第215行,主要       status = self.run(options,args)     文件" /Library/Python/2.7/site-packages/pip/commands/install.py" ;,第317行,在运行中       PREFIX = options.prefix_path,     File" /Library/Python/2.7/site-packages/pip/req/req_set.py" ;,第736行,安装中       requirement.uninstall(auto_confirm =真)     文件" /Library/Python/2.7/site-packages/pip/req/req_install.py" ;,第742行,在卸载中       paths_to_remove.remove(auto_confirm)     File" /Library/Python/2.7/site-packages/pip/req/req_uninstall.py" ;,第115行,删除       重命名(path,new_path)     文件" /Library/Python/2.7/site-packages/pip/utils/ init .py",第267行,重命名       shutil.move(旧的,新的)     File" /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py" ;,第299行,移动       copytree(src,real_dst,symlinks = True)     文件" /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py" ;,第208行,在copytree中       提出错误,错误   错误:[(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .py',' / tmp / pip-aYpqDT-uninstall / System / Library / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .py'," [Errno 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&#39 ;,' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc' ," [Errno 1]不允许操作:' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc'"),(' /System/Library/Frameworks/Python.framework/Versions/2.7/ Extras / lib / python / _markerlib / markers.py',' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ markers.py'," [Errno 1]不允许操作:' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/ python / _markerlib / markers.py'"),(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc' ,' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc' ;," [Errno 1 ]不允许操作:' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'" ),(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib' ;,' / tmp / pip-aYpqDT-uninstall / System / Library /框架/ Python.framework /版本/ 2.7 /附加/ LIB /蟒/ _markerlib' ," [Errno 1]不允许操作:' /tmp/pip-aYpqDT-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib' &#34)]

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

3 个答案:

答案 0 :(得分:1)

对我有用的是:

         xmlns:local="clr-namespace:myAssembly" 

答案 1 :(得分:1)

我通过以下命令解决了这个问题:

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

答案 2 :(得分:0)

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

env LDFLAGS =“ - L $(brew --prefix openssl)/ lib”CFLAGS =“ - I $(brew --prefix openssl)/ include”pip install cryptography