3

I am using FreeBSD 11, Python 3.7, and clang 8.0.0, and I am trying to install Python packages using pip. But when I try to install a package, for example pycurl, I get an error saying it can't find the C header file limits.h.

I use this command to install pycurl:

pip3.7 install pycurl

Error:

In file included from src/pycurl.h:5:<br/>
/usr/local/include/python3.7m/Python.h:11:10: fatal error: 'limits.h' file not found
#include <limits.h>
         ^~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1

In an effort to get the missing header files I have installed the following FreeBSD packages:

  • amd64-binutils-2.33.1_2,1
  • amd64-gcc-6.4.0_8
  • amd64-xtoolchain-gcc-0.4_1
  • llvm-devel-11.0.d20200519 # Yes I know that this one is not helpful, but I am getting desperate
  • mpc-1.1.0_2
  • mpfr-4.0.2
  • xtoolchain-llvm80-0.1

This installs the limits.h file, but now when I compile it fails to find syslimits.h.

I used this command to install pycurl:

pip3.7 install --global-option=build_ext --global-option=/x86_64-portbllib/gcc9/gcc/x86_64-portbld-tools/include/" pycurl

Error:

In file included from /usr/local/include/python3.7m/Python.h:11:
/usr/local/lib/gcc/x86_64-unknown-freebsd11.3/6.4.0/install-tools/include/limits.h:34:10: fatal error: 'syslimits.h' file not found
#include "syslimits.h"
         ^~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1

What packages do I need to install in order to install Python packages?

1 Answer 1

3

Official FreeBSD packages already contain ftp/py-pycurl package. Do you really need to compile it yourself?

If you do, I recommend installing FreeBSD Ports tree and running make -C /usr/ports/ftp/py-pycurl build command to see exactly how it is built. This should give an idea what are you doing wrong when compiling manually.

1
  • Mostly because I am used to using pip to install Python packages. And a quick search in the FreeBSD packages I couldn't find it. But a thorough search showed me it was there.
    – Fred
    Jul 9, 2020 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.