简体   繁体   中英

when I try to install Flask-bcrypt it throws me error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

When I try to install flask-bcrypt library for my app it is throwing me this error:

creating 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

how to solve it?? -thanks in advance!

if you find that after installing Python-dev and u having trouble then install the Foreign function interface. thats when i was able to install brypt:

sudo apt-get install libffi-dev

须藤apt-get install python-dev

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

您需要安装python-dev软件包才能构建Python扩展。

You didn't mention what OS you're using, but you need to have Python-dev installed.

Assuming Ubuntu:

sudo apt-get install python-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM