apache / apache/arrow

[Python] get_include() gives wrong directory in conda environment

Open
#33,326 2 comments 0 reactions 0 assignees View on GitHub
Component: Python Priority: Critical Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

`get_include` seems to do:

 
```java

def get_include():
    """
    Return absolute path to directory containing Arrow C++ include
    headers. Similar to numpy.get_include
    """
    return _os.path.join(_os.path.dirname(__file__), 'include')
```
This returns something like:
```java

/path/to/myconda/envs/envname/lib/python3.8/site-packages/pyarrow/include
```
which does not exist in a conda environment. The path where the headers actually get installed is to:

 
```java

$ echo $CONDA_PREFIX
/path/to/myconda/envs/envname

$ ls $CONDA_PREFIX/include/arrow | head
adapters
api.h
array
array.h
buffer_builder.h
buffer.h
builder.h
c
chunked_array.h
chunk_resolver.h
```

**Environment**: conda
**Reporter**: [Left Screen](https://issues.apache.org/jira/browse/ARROW-18129)
#### Related issues:
- [[Python] PyArrow C++ header files no longer always included in installed pyarrow](https://github.com/apache/arrow/issues/33509) (is related to)

**Note**: *This issue was originally created as [ARROW-18129](https://issues.apache.org/jira/browse/ARROW-18129). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start at the Python get_include() implementation and compare its returned path with the conda layout shown in the issue. Trace how the conda package installs the Arrow C++ headers, then update the include-path behavior so it points to the installed headers and verify it in a conda environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.