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

百般思念 提交于 2019-12-08 03:30:17

问题


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!


回答1:


sudo apt-get install python-dev




回答2:


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




回答3:


Depending on your configuration you might need to install the python3-dev package.




回答4:


You need python-dev package installed to build Python extensions.




回答5:


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


来源:https://stackoverflow.com/questions/28363514/when-i-try-to-install-flask-bcrypt-it-throws-me-error-command-x86-64-linux-gnu

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