pyconfig.h missing during "pip install cryptography"
Asked Answered
B

6

28

I wanna set up scrapy cluster follow this link scrapy-cluster,Everything is ok before I run this command:

pip install -r requirements.txt

The requirements.txt looks like:

cffi==1.2.1
characteristic==14.3.0
ConcurrentLogHandler>=0.9.1
cryptography==0.9.1
...

I guess the above command means to install packages in requirements.txt.But I don't want it to specify the version,So I change it to this:

cat requirements.txt | while read line; do pip install ${line%%[>=]*} --user;done

When install cryptography,it gives me the error:

build/temp.linux-x86_64-2.7/_openssl.c:12:24:fatal error:pyconfig.h:No such file or directory 
#include <pyconfig.h>

I don't know how to solved this , I have tried a lot of methods ,but failed. my system is centos 7, and the version of python is 2.7.5(default). Besides, Is there any other scrapy frame which is appliable for a large number of urls . Thanks in advance

Boredom answered 14/10, 2016 at 8:9 Comment(0)
I
38

For Ubuntu, python2

apt-get install python-dev 

For Ubuntu, python3

apt-get install python3-dev
Irmairme answered 4/11, 2016 at 20:45 Comment(1)
apt-get install python3.6-dev did it for me.Adela
B
19

I have solved it by myself. for the default python of centos, there is only a file named pyconfg-64.h in usr/include/python2.7/,So run the command

yum install python-devel

Then it works.

Boredom answered 14/10, 2016 at 10:25 Comment(0)
S
12

for python3.6,

apt-get install python3.6-dev

and

apt-get install libssl-dev libffi-dev

Shrivel answered 16/6, 2017 at 20:7 Comment(1)
apt-get install libssl-dev libffi-dev help mePickett
P
1

i use python 2 on ubuntu and got the same problem when installing cryptography. after i run this command

apt-get install python-dev libssl-dev libffi-dev

then it works.

Pickett answered 21/6, 2017 at 8:9 Comment(0)
D
1

For Python 3.7 on Debian, the following works for me.

apt-get install python3.7-dev

and

apt-get install libssl-dev

You may also need:

apt-get install libffi-dev
Docker answered 21/10, 2019 at 23:47 Comment(0)
F
0

On a Debian based distro (AntiX distro), together with apt-get install python3-dev, I also installed rust, to complete successfully the pip3 install cryptography command. So, I gave:

    $ sudo apt-get install build-essential curl python3-dev libssl-dev libffi-dev
    $ sudo curl https://sh.rustup.rs -sSf | sh

(Figure 1) | Rust installation

When prompted (Figure 1), type 1 and hit Enter on your keyboard. Once it completes, you have to give following commands:

    $ source $HOME/.cargo/env
    $ source ~/.profile
    $ pip3 install cryptography
Finicking answered 19/4, 2022 at 20:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.