Resolve scrapy Error No module named Cryptography.hazmat.bind

Source: Internet
Author: User

Running under Linux is an error that occurs with Importerror:no module named Cryptography.hazmat.bindings.openssl.binding.

The reason is that craptography is not installed. If you install cryptography directly, you will see no errors for the libffi and cffi files. Indicates that if you need to configure Libffi and Cffi first, you need to configure Libffi and then configure Cffi.

1, configure the Libffi steps:

How to install via source under Ubuntu:

wget Ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gztar zxvf libffi-3.0.11.tar.gzcd libffi-3.0.11/. Configuremake sudo make install

(It is important to be sure to install it under sudo, which will not be installed if you make the install directly)

2, after the configuration Libffi can be directly used PIP installation Cffi, installed after cffi to install the discovery or can not install cryptography, this time through the official website to find a solution (or the official use AH).

Installation Required before installing cryptography

build-essential   Libssl-dev    Libffi-dev Python-dev These four bags

How to install the above four packages under Ubuntu:

sudo apt-get install build-essential libssl-dev libffi-dev Python-dev

3. After installing the above four packages, you can install cryptography.

Pip Install Crpytography

The above are installed before running the Scrapy program will not be a problem.


Resolve scrapy Error No module named Cryptography.hazmat.bind

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.