Issue 1: mysqlclient Compilation Error During bench get-app
Insights depends on ibis-framework[mysql], which requires the mysqlclient Python package—a C extension that needs MariaDB development headers.
The Error
During the Docker build:
Trying pkg-config --exists libmariadb
Command 'pkg-config --exists libmariadb' returned non-zero exit status 127.
/bin/sh: 1: pkg-config: not found
Exception: Can not find valid pkg-config name.
Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manuallyThis happened because the base frappe/erpnext image lacks pkg-config and MariaDB dev packages.
The Fix
I updated my Containerfile to install the necessities as root:
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libmariadb-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
USER frappe
# Set env vars to skip pkg-config
ENV MYSQLCLIENT_CFLAGS="-I/usr/include/mariadb"
ENV MYSQLCLIENT_LDFLAGS="-L/usr/lib -lmariadb"This forces mysqlclient to build from source using explicit paths, keeping the image lean (no pkg-config needed). Rebuild the image, and the bench get-app step succeeds.
Issue 2: NumPy Baseline Optimization Error During bench install-app
After getting the app, running bench --site site.name install-app insights failed with:
RuntimeError: NumPy was built with baseline optimizations: (X86_V2) but your machine doesn't support: (X86_V2).
NumPy 2.0+ (here v2.4.1) requires x86-64-v2 features (SSE4.2, SSSE3, POPCNT), but my VM didn't expose them.
The Cause
Proxmox VM default CPU type (kvm64 or similar) emulates a minimal CPU without passing through host features. My Xeon Silver 4510 supports these, but the guest OS didn't see them (grep sse4_2 /proc/cpuinfo returned nothing).
The Fix
In Proxmox UI:
- Shut down VM.
- Hardware > Processor > Edit > Type: Set to host.
- Or, change the machine type to q35 (which I did not try)
This passes through the real CPU capabilities. No more NumPy error!