Python 当我尝试安装Flask bcrypt时,它抛出错误:command';x86#u 64-linux-gnu-gcc';失败,退出状态为1

Python 当我尝试安装Flask bcrypt时,它抛出错误:command';x86#u 64-linux-gnu-gcc';失败,退出状态为1,python,ubuntu,flask,bcrypt,Python,Ubuntu,Flask,Bcrypt,当我尝试为我的应用程序安装flask bcrypt库时,它向我抛出以下错误: 创建build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/bcrypt x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c b

当我尝试为我的应用程序安装flask bcrypt库时,它向我抛出以下错误:

创建build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/bcrypt

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c bcrypt/bcrypt.c -o build/temp.linux-x86_64-2.7/bcrypt/bcrypt.o

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c bcrypt/bcrypt_pbkdf.c -o build/temp.linux-x86_64-2.7/bcrypt/bcrypt_pbkdf.o

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c bcrypt/bcrypt_python.c -o build/temp.linux-x86_64-2.7/bcrypt/bcrypt_python.o

bcrypt/bcrypt_python.c:18:20: fatal error: Python.h: No such file or directory

 #include "Python.h"
^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
怎么解决呢??
-提前谢谢

您需要安装
python dev
包来构建python扩展。

您需要安装
python dev
包来构建python扩展。

您没有提到您正在使用的操作系统,但您需要安装python dev

假设Ubuntu:

sudo apt-get install python-dev

您没有提到您正在使用的操作系统,但是您需要安装pythondev

假设Ubuntu:

sudo apt-get install python-dev

sudo-apt-get-install-python-dev

sudo-apt-get-install-python-dev

根据您的配置,您可能需要安装
python-dev
包。

如果您在安装python-dev之后发现您有问题,则可能需要安装
python-dev
包然后安装外部功能接口。这就是我能够安装brypt的时候:


sudo apt get install libffi dev

如果在安装Python dev和u后发现有问题,请安装外部函数接口。这就是我能够安装brypt的时候:


sudo apt get install libffi dev

已经安装了python dev和libffi dev,但错误仍然没有消失,安装python 3 dev工作正常。已经安装了python dev和libffi dev,但错误仍然没有消失,安装python 3 dev工作正常。