GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Tests fail to find Python.h · Issue #272 · xtensor-stack/xtensor-python

Tests fail to find Python.h #272

New issue
Copy link
New issue
Copy link
Open
Open
Tests fail to find Python.h#272
Copy link

Description

@yurivict
yurivict
opened on Nov 27, 2021
Issue body actions

First it failed like this:

In file included from /usr/local/include/pybind11/pytypes.h:12:
/usr/local/include/pybind11/detail/common.h:186:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~

then it failed like this:

In file included from /usr/local/include/xtensor-python/pytensor.hpp:22:
/usr/local/include/xtensor-python/pycontainer.hpp:30:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
         ^~~~~~~~~~~~~~~~~~~~~

I had to add these arguments to fix these failures:

CXXFLAGS=-I${PYTHON_INCLUDEDIR} -I${PYTHON_SITELIBDIR}/numpy/core/include

It should find relevant headers by itself.

Activity

  1. SylvainCorlay commented on Nov 27, 2021

    @SylvainCorlay
    SylvainCorlay
    on Nov 27, 2021
    Member
    More actions

    When things are not found, the right definition to add is PYTHON_EXECUTABLE. We have found that more aggressive search strategies often ended up finding other python installs and linking with the wrong version.

  2. yurivict commented on Nov 27, 2021

    @yurivict
    yurivict
    on Nov 27, 2021
    Author
    More actions

    cmake finds the python executable fine:

    -- Found PythonInterp: /usr/local/bin/python3.8 (found version "3.8.12") 
    -- Found PythonLibs: /usr/local/lib/libpython3.8.so
    

    It can't find the headers.
    Based on docs the same command that finds the python executable, FindPython, outputs the headers' location.

  3. SylvainCorlay commented on Nov 27, 2021

    @SylvainCorlay
    SylvainCorlay
    on Nov 27, 2021
    Member
    More actions

    Thanks. Is this happening on a distribution a patched cpython distribution? We rely on the same approach as pybind11 for this ...

  4. yurivict commented on Nov 27, 2021

    @yurivict
    yurivict
    on Nov 27, 2021
    Author
    More actions

    This is happening in the FreeBSD port.

  5. SylvainCorlay commented on Nov 27, 2021

    @SylvainCorlay
    SylvainCorlay
    on Nov 27, 2021
    Member
    More actions

    Okay. I don't know if the freebsd port patches cpython. We had some serious headaches in the past with Debian patching it to split between dist-packages and site-packages.
    In any case we should address the freebsd case.

  6. tdegeus commented on Mar 2, 2023

    @tdegeus
    tdegeus
    on Mar 2, 2023
    Member
    More actions

    Not sure if this is the issue : https://conda-forge.org/docs/maintainer/knowledge_base.html ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.