问题
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