如何在Ubuntu上安装加密? [英] How to install cryptography on ubuntu?
问题描述
我的ubuntu是14.04 LTS。
当我安装加密时,错误是:
安装egg-scripts。
使用命名空间包,但是分发不需要setuptools。
获取'cryptography == 0.2.1'的分发。
没有找到匹配'documentation / _build'的先前包含的目录
zip_safe标志未设置;分析存档内容...
六:模块引用__path__
安装/tmp/easy_install-oUz7ei/cryptography-0.2.1/.eggs/six-1.10.0-py2.7。 egg
搜索cffi> = 0.8
阅读https://pypi.python.org/simple/cffi/
最佳匹配:cffi 1.5.0
下载https:// pypi.python.org/packages/source/c/cffi/cffi-1.5.0.tar.gz#md5=dec8441e67880494ee881305059af656
处理cffi-1.5.0.tar.gz
编写/ tmp / easy_install -oUz7ei / cryptography-0.2.1 / temp / easy_install-Yf2Yl3 / cffi-1.5.0 / setup.cfg
运行cffi-1.5.0 / setup.py -q bdist_egg --dist-dir / tmp / easy_install -oUz7ei / cryptography-0.2.1 / temp / easy_install-Yf2Yl3 / cffi-1.5.0 / egg-dist-tmp-A2kjMD
c / _cffi_backend.c:15:17:fatal error:ffi.h:No such文件或目录
#include< ffi.h>
^
编译终止。
错误:安装脚本退出时出错:命令'x86_64-linux-gnu-gcc'失败,退出状态1
尝试安装密码术0.2.1时出错。查看上面的消息,以查看easy_install输出的任何错误。
While:
安装egg-scripts。
获取'cryptography == 0.2.1'的分发。
错误:无法安装:cryptography 0.2.1
我不知道为什么它失败了。是什么原因。
答案在于加密技术的文档
的安装部分,这几乎反映了Angelos'回答:
引用:
对于Debian和 Ubuntu ,以下命令将确保安装了
所需的依赖项:$ sudo apt-get install build-essential libssl-dev libffi-dev python-dev
对于Fedora和RHEL衍生版,命令将确保
安装所需的依赖关系:$ sudo yum install gcc libffi-devel python-devel openssl -devel
您现在应该可以使用
通常
$ pip install cryptography
< blockquote>My ubuntu is 14.04 LTS.
When I install cryptography, the error is:
Installing egg-scripts. uses namespace packages but the distribution does not require setuptools. Getting distribution for 'cryptography==0.2.1'. no previously-included directories found matching 'documentation/_build' zip_safe flag not set; analyzing archive contents... six: module references __path__ Installed /tmp/easy_install-oUz7ei/cryptography-0.2.1/.eggs/six-1.10.0-py2.7.egg Searching for cffi>=0.8 Reading https://pypi.python.org/simple/cffi/ Best match: cffi 1.5.0 Downloading https://pypi.python.org/packages/source/c/cffi/cffi-1.5.0.tar.gz#md5=dec8441e67880494ee881305059af656 Processing cffi-1.5.0.tar.gz Writing /tmp/easy_install-oUz7ei/cryptography-0.2.1/temp/easy_install-Yf2Yl3/cffi-1.5.0/setup.cfg Running cffi-1.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-oUz7ei/cryptography-0.2.1/temp/easy_install-Yf2Yl3/cffi-1.5.0/egg-dist-tmp-A2kjMD c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory #include <ffi.h> ^ compilation terminated. error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 An error occurred when trying to install cryptography 0.2.1. Look above this message for any errors that were output by easy_install. While: Installing egg-scripts. Getting distribution for 'cryptography==0.2.1'. Error: Couldn't install: cryptography 0.2.1
I don't know why it was failed. What is the reason. Is there something necessary when install it on ubuntu system?
解决方案The answer is on the docs of
cryptography
's installation section which pretty much reflects Angelos' answer:Quoting it:
For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
$ sudo apt-get install build-essential libssl-dev libffi-dev python-dev
For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
$ sudo yum install gcc libffi-devel python-devel openssl-devel
You should now be able to build and install cryptography with the usual
$ pip install cryptography
这篇关于如何在Ubuntu上安装加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!