[Python] Apple Silicon (ARM64), but mysqlclient built as x86_64

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    Compiled binary is Intel-only, not native ARM64 from pip for venv. Interestingly I see that the created wheel is arm based:

    $ pip install mysqlclient
    Collecting mysqlclient
    Downloading mysqlclient-2.2.7.tar.gz (91 kB)
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Preparing metadata (pyproject.toml) ... done
    Building wheels for collected packages: mysqlclient
    Building wheel for mysqlclient (pyproject.toml) ... done
    Created wheel for mysqlclient: filename=mysqlclient-2.2.7-cp312-cp312-macosx_11_0_arm64.whl size=75876 sha256=389bc727cf6a34eaeaa6811dedb8ca0de6739f5957b9908470833768809f0445
    Stored in directory: /Users/daniel.yu/Library/Caches/pip/wheels/27/95/18/7f176fffd46629e710c04c810b9c4d7d4358fe7c96a7d2306d
    Successfully built mysqlclient
    Installing collected packages: mysqlclient
    Successfully installed mysqlclient-2.2.7


    The catch is that at the end, the executable is intel-based.

    $ file lib/python3.12/site-packages/MySQLdb/_mysql.cpython-312-darwin.so
    lib/python3.12/site-packages/MySQLdb/_mysql.cpython-312-darwin.so: Mach-O 64-bit bundle x86_64


    The binary file from python is also arm64 based

    $ file "$(which python)"
    /pathToPython/bin/python: Mach-O 64-bit executable arm64


    Where should I report this Issue? How should I debug it? I already reinstalled python and mysql, deactivated Rosetta on my terminal.

    Continue reading...

Compartilhe esta Página