команда выполнена: pip3 install PyGreSQL

Это терпит неудачу со следующей ошибкой.

фатальная ошибка: linux/limit.h: нет такого файла или каталога

ошибка: команда 'cc' завершилась неудачно с состоянием выхода 1

ошибка с кодом ошибки 1 в /tmp /pip-install-x3puix39 /PyGreSql /

Полный журнал:

pip install PyGreSQL
The directory '/home/ec2-user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ec2-user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting PyGreSQL
  Downloading https://files.pythonhosted.org/packages/4a/65/03b1cd9b6daaa4e32ee72dd5fb1a01fbb7cd0dfe5439e34af6caa6ec60dc/PyGreSQL-5.0.6.tar.gz (648kB)
    100% |████████████████████████████████| 655kB 27.8MB/s 
Installing collected packages: PyGreSQL
  Running setup.py install for PyGreSQL ... error
    Complete output from command /home/linuxbrew/.linuxbrew/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-i1r203v3/PyGreSQL/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-_3noeeqb/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    copying pg.py -> build/lib.linux-x86_64-3.7
    copying pgdb.py -> build/lib.linux-x86_64-3.7
    running build_ext
    building '_pg' extension
    creating build/temp.linux-x86_64-3.7
    cc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPYGRESQL_VERSION=5.0.6 -DDIRECT_ACCESS -DLARGE_OBJECTS -DDEFAULT_VARS -DESCAPING_FUNCS -I/home/linuxbrew/.linuxbrew/opt/python/include/python3.7m -I/home/linuxbrew/.linuxbrew/Cellar/postgresql/11.1_1/include -I/home/linuxbrew/.linuxbrew/include -I/home/linuxbrew/.linuxbrew/opt/openssl/include -I/home/linuxbrew/.linuxbrew/opt/sqlite/include -I/home/linuxbrew/.linuxbrew/opt/python/include/python3.7m -c pgmodule.c -o build/temp.linux-x86_64-3.7/pgmodule.o -O2 -funsigned-char -Wall -Werror
    In file included from /home/linuxbrew/.linuxbrew/include/bits/posix1_lim.h:160:0,
                     from /home/linuxbrew/.linuxbrew/include/limits.h:143,
                     from /home/linuxbrew/.linuxbrew/Cellar/gcc/5.5.0_4/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed/limits.h:168,
                     from /home/linuxbrew/.linuxbrew/Cellar/gcc/5.5.0_4/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed/syslimits.h:7,
                     from /home/linuxbrew/.linuxbrew/Cellar/gcc/5.5.0_4/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed/limits.h:34,
                     from /home/linuxbrew/.linuxbrew/opt/python/include/python3.7m/Python.h:11,
                     from pgmodule.c:32:
    /home/linuxbrew/.linuxbrew/include/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
    compilation terminated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/home/linuxbrew/.linuxbrew/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-i1r203v3/PyGreSQL/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-_3noeeqb/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-i1r203v3/PyGreSQL/

Мой Linux дистрибутив:

cat /etc/*release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2018.03

обновление: sudo yum install kernerl-devel не работает. получил ту же ошибку после выполнения

1 ответ1

0

Попробуйте пакет libc-dev; но также посмотрите и убедитесь, что нужные заголовки присутствуют в /usr/include/linux/ и что ваша $PATH или, возможно, установили переменную C_INCLUDE_PATH чтобы компилятор знал, где найти заголовки библиотеки.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .