我正在尝试安装pgAdmin4在Ubuntu 18.04下列的本教程,但是使用命令时出现以下错误pip install pgadmin4-2.1-py2.py3-none-any.whl
:
src/_fastmath.c:31:10: 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
----------------------------------------
Command "/home/hugolvc/pgAdmin4/pgAdmin4/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Eiam7O/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-xfTq9G/install-record.txt --single-version-externally-managed --compile --install-headers /home/hugolvc/pgAdmin4/pgAdmin4/include/site/python2.7/pycrypto" failed with error code 1 in /tmp/pip-install-Eiam7O/pycrypto/
我只是一步一步按照教程进行操作。
编辑
的结果python --version
是Python 2.7.15rc1
,但是我也安装了3.6和3.7。
其结果locate x86_64-linux-gnu-gcc
是:
/usr/bin/x86_64-linux-gnu-gcc
/usr/bin/x86_64-linux-gnu-gcc-5
/usr/bin/x86_64-linux-gnu-gcc-7
/usr/bin/x86_64-linux-gnu-gcc-ar
/usr/bin/x86_64-linux-gnu-gcc-ar-5
/usr/bin/x86_64-linux-gnu-gcc-ar-7
/usr/bin/x86_64-linux-gnu-gcc-nm
/usr/bin/x86_64-linux-gnu-gcc-nm-5
/usr/bin/x86_64-linux-gnu-gcc-nm-7
/usr/bin/x86_64-linux-gnu-gcc-ranlib
/usr/bin/x86_64-linux-gnu-gcc-ranlib-5
/usr/bin/x86_64-linux-gnu-gcc-ranlib-7
/usr/share/man/man1/x86_64-linux-gnu-gcc-5.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-7.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ar-5.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ar-7.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ar.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-nm-5.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-nm-7.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-nm.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ranlib-5.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ranlib-7.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc-ranlib.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gcc.1.gz
其结果sudo find / -name "Python.h"
是:
/home/hugolvc/.local/share/Trash/files/Python-3.7.0/Include/Python.h
find: ‘/run/user/1000/gvfs’: Permission denied
答案1
python-dev
使用以下命令安装包:
sudo apt-get install python-dev # for python2
sudo apt-get install python3-dev # for python3