Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't pip install from arm64 docker container #83

Open
d3v-null opened this issue Oct 30, 2024 · 0 comments
Open

can't pip install from arm64 docker container #83

d3v-null opened this issue Oct 30, 2024 · 0 comments

Comments

@d3v-null
Copy link
Contributor

Apple M-series arm chips can't natively run amd64 Docker images, an x86 machine needs to be emulated, which is currently a bit of a mess. The latest macOS Sequoia broke the ability for Docker to do this emulation, and I run into many random segfault issues that don't show up when running the same image on x86. The solution is to build multiplatform docker images, with amd64 and arm64, but mwalib can't be installed with pip in these images.

You can reproduce the issue with the following piptest.Dockerfile

FROM python:3.11-slim-bookworm
RUN python -m pip install --no-cache-dir \
    maturin[patchelf]==1.7.4 \
    pip==24.3.1
RUN python -m pip install --no-cache-dir \
    mwalib

If you're on an arm machine, you can build with docker build -f piptest.Dockerfile . Otherwise, you'll need to set up a docker buildx container with docker buildx create --driver=docker-container --name=multi --use and build with docker buildx build --platform linux/arm64

In either case, the result is the same. pip has no issue pulling maturin, but pulls an old version of mwalib, which fails to find maturin.

 > [2/3] RUN python -m pip install --no-cache-dir     maturin[patchelf]==1.7.4     pip==24.3.1
1.014 Downloading maturin-1.7.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl (8.4 MB)
...
 > [3/3] RUN python -m pip install --no-cache-dir     mwalib:                                                                                                                                                                                                 
0.284 Collecting mwalib                                                                                                                                                                                                                                       
0.378   Downloading mwalib-1.3.0.tar.gz (364 kB)                                                                                                                                                                                                              
0.468      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 364.2/364.2 kB 4.1 MB/s eta 0:00:00                                                                                                                                                                        
0.484   Installing build dependencies: started                                                                                                                                                                                                                
3.445   Installing build dependencies: finished with status 'done'
3.445   Getting requirements to build wheel: started
3.462   Getting requirements to build wheel: finished with status 'done'
3.464 ERROR: Exception:
...
3.464 ModuleNotFoundError: No module named 'maturin'
3.464 
3.747 
3.747 [notice] A new release of pip is available: 24.0 -> 24.3.1
3.747 [notice] To update, run: pip install --upgrade pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant