pybind11 icon indicating copy to clipboard operation
pybind11 copied to clipboard

fix docs build command on different global and venv python versions

Open nikulpatel3141 opened this issue 1 year ago • 2 comments

Description

The build command in the docs fails when using a python venv with a different version to the global installation as python3-config will use the global one.

For example on a machine with global python 3.12 in a venv using python 3.11:

(venv) $ python3-config --extension-suffix  # .cpython-311-x86_64-linux-gnu.so

(venv) $ python3 -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))'  # .cpython-312-x86_64-linux-gnu.so

This silently causes a 'ModuleNotFound' error as the venv cannot import the generated pybind module.

Suggested changelog entry:

nikulpatel3141 avatar Sep 08 '24 12:09 nikulpatel3141

I wonder if we should just bite the bullet and provide a --extension-suffix flag on pybind11-config?

henryiii avatar Sep 27 '24 16:09 henryiii

I wonder if we should just bite the bullet and provide a --extension-suffix flag on pybind11-config?

Sounds good to me.

rwgk avatar Sep 27 '24 16:09 rwgk