Skip to content

How to get path to cibuildwheel's Python location? #985

Answered by DBraun
DBraun asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks, good suggestion. In order to not overlap with pythonLocation from setup-python, I tried to export pythonLocation2:

CIBW_BEFORE_ALL_MACOS: |
    echo $(which python3-config)
    export pythonLocation2=$(python3-config --prefix)
    echo "pythonLocation2 is $pythonLocation2"

and got

/Users/runner/hostedtoolcache/Python/3.8.12/x64/bin/python3-config
pythonLocation2 is /Users/runner/hostedtoolcache/Python/3.8.12/x64

But it was a Python 3.10 cibuildwheel choice. So python3-config resolves to the wrong one inside CIBW_BEFORE_ALL_MACOS. Any other suggestions?

Update:
As @mayeut said below, it works if it's inside CIBW_BEFORE_BUILD

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mayeut
Comment options

@DBraun
Comment options

@DBraun
Comment options

Answer selected by DBraun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants