python - 当我尝试安装 Flask-bcrypt 时它抛出错误 : command 'x86_64-linux-gnu-gcc' failed with exit status 1

标签 python ubuntu flask bcrypt

当我尝试为我的应用程序安装 flask-bcrypt 库时,它抛出了这个错误:

创建构建/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 后遇到问题,请安装 Foreign 函数接口(interface)。那是我能够安装 brypt 的时候:

sudo apt-get install libffi-dev

关于python - 当我尝试安装 Flask-bcrypt 时它抛出错误 : command 'x86_64-linux-gnu-gcc' failed with exit status 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28363514/

相关文章:

python - 如何使用 feed 解析器 python 解析 xml feed?

mysql - 无法导入名称 'Datetime' python flask sqlalchemy

c# - 在 Ubuntu/Mono 上运行的 HttpListener 返回 400 错误请求

database - 如何在 Flask 应用程序中使用 pytest 清除/拆卸数据库

python-3.x - 找不到 Jinja 嵌套模板

python - 模块 'skimage.filters' 没有属性 'gaussian_filter'

python - 如何在一段时间内启动/停止 Python 函数(例如从上午 10 点到 12 点 :30pm)?

python - python 读取 JSON 文件的问题

ubuntu - 在 Ubuntu 上使用 Quicklisp 安装 GSLL 的问题

ubuntu - GRUB 的多个 EFI 可执行文件的引导行为