Skip to content

missing limits.h during install #3353

Closed
@sjanssen2

Description

@sjanssen2

sudo apt install gcc # alternatively, you can install clang instead

I just set up a new virtual machine, Linux Mint, which is based on Ubuntu Jammy and followed the installation instructions.
I hit an issue with pip install . --no-binary redbiom which failed to compile with the error message:

gcc -pthread -B /home/qiita/miniforge3/envs/qiita/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/qiita/miniforge3/envs/qiita/include -fPIC -O2 -isystem /home/qiita/miniforge3/envs/qiita/include -fPIC "-DPSYCOPG_VERSION=2.9.9 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130014 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/home/qiita/miniforge3/envs/qiita/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-39/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from /usr/include/postgresql/limits.h:34,
                       from /home/qiita/miniforge3/envs/qiita/include/python3.9/Python.h:11,
                       from ./psycopg/psycopg.h:35,
                       from psycopg/adapter_asis.c:28:
      /usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h:7:15: fatal error: limits.h: No such file or directory
          7 | #include_next <limits.h>
            |               ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/gcc' failed with exit code 1

It turned out, that the machine had gcc but no g++ installed. After adding thus, installation ran smoothly. I therefor recommend adding g++ in line 167 to the install instructions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions