Skip to content

[Documentation] Add system dependencies and installation requirements #1

@PhiAlex-baiye

Description

@PhiAlex-baiye

Problem

The current README doesn't mention the requirement for Python development headers, causing compilation failures on fresh systems.

Error Message

致命错误:Python.h:没有那个文件或目录
    2 | #include <Python.h>
      |          ^~~~~~~~~~
编译中断。

Impact

  • New users cannot compile the project without additional system packages
  • moon run and moon test both fail immediately
  • No clear guidance on what dependencies are needed

Solution

Add a "System Requirements" section to README with installation commands for different distributions:

System Requirements

Fedora/RHEL/CentOS:

sudo dnf install python3-devel

Debian/Ubuntu:

sudo apt-get install python3-dev

Arch Linux:

sudo pacman -S python

macOS:

# Usually included with Xcode Command Line Tools
xcode-select --install

# Or via Homebrew
brew install python

Environment

  • OS: Fedora 42 (Linux 6.15.8-200.fc42.x86_64)
  • Python: 3.13.5
  • Error occurs: During compilation of C extensions

Additional Information

This requirement exists because:

  1. The project uses Python C API through Kaida-Amethyst/python dependency
  2. C compilation requires Python development headers (Python.h)
  3. Most Linux distributions separate runtime packages from development packages

Suggested README Section

## System Requirements

### Python Development Headers

This project requires Python development headers for C extension compilation.

**Linux (Fedora/RHEL/CentOS):**
```bash
sudo dnf install python3-devel

Linux (Debian/Ubuntu):

sudo apt-get install python3-dev

Linux (Arch):

sudo pacman -S python

macOS:

xcode-select --install

Verification:
After installation, verify the headers are available:

python3-config --includes
# Should output something like: -I/usr/include/python3.13

## Related Issues

This documentation fix will prevent the compilation issues described in other related bugs.

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