Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/src/en/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

2. Get an error message like "cannot find Python package" when building.

The reason is that when building a Python binding package, we need the header and other necessary modules.
The reason is that building Python bindings requires Python's development headers and libraries.

If you can install software directly,
If you have administrative privileges, you can use your system's package manager to install the required package. For example:
* **Debian/Ubuntu**: `sudo apt install python3-dev`
* **RHEL/CentOS/Fedora**: `sudo yum install python3-devel`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While yum is correct for older RHEL/CentOS versions (like 7), modern versions (8+) and recent Fedora releases use dnf as the default package manager. Using dnf in the documentation would be more accurate for a larger set of users. On many systems where dnf is standard, yum is an alias to dnf, but it's better to be explicit and use the modern tool.

Suggested change
* **RHEL/CentOS/Fedora**: `sudo yum install python3-devel`
* **RHEL/CentOS/Fedora**: `sudo dnf install python3-devel`

* **macOS**: Installing Python with Homebrew (`brew install python`) is usually sufficient.

```shell
[sudo] apt install python3-dev
```
If not, please install Python somewhere and set environment variables to help the building system find them.
Alternatively, if you installed Python in a custom location, you must set environment variables to help the build system find it. Remember to replace the placeholders in the command below with your actual paths.

```shell
export CMAKE_ARGS="-DPython3_ROOT_DIR=${Python3_ROOT_DIR} -DPython3_INCLUDE_DIR=${Python3_INCLUDE_DIR} -DPython3_EXECUTABLE=${Python3_EXECUTABLE}"
Expand Down