pyconfig.h missing during “pip install cryptography”

大城市里の小女人 提交于 2019-12-30 05:48:45

问题


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


回答1:


For Ubuntu, python2

apt-get install python-dev 

For Ubuntu, python3

apt-get install python3-dev



回答2:


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.




回答3:


for python3.6,

apt-get install python3.6-dev

and

apt-get install libssl-dev libffi-dev




回答4:


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.




回答5:


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


来源:https://stackoverflow.com/questions/40038134/pyconfig-h-missing-during-pip-install-cryptography

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!