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

"docker compose build" not working on Mac (M1 Max) #36

Open
OneWind opened this issue Apr 19, 2024 · 5 comments
Open

"docker compose build" not working on Mac (M1 Max) #36

OneWind opened this issue Apr 19, 2024 · 5 comments

Comments

@OneWind
Copy link

OneWind commented Apr 19, 2024

I constantly got this error, although I installed pkg-config, added /opt/homebrew and /opt/homebrew/bin to PATH, and I set up HDF5_DIR=/opt/homebrew/opt

46.21 Building h5py requires pkg-config unless the HDF5 path is explicitly specified using the environment variable HDF5_DIR. For more information and details, see https://docs.h5py.org/en/stable/build.html#custom-installation
46.21 error: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory')
46.21 [end of output]
46.21
46.21 note: This error originates from a subprocess, and is likely not a problem with pip.
46.21 ERROR: Failed building wheel for h5py

@DucHUNG312
Copy link

DucHUNG312 commented Apr 20, 2024

I fixed it by adding pkg-config and libhdf5-dev to the RUN apt-get install line in the Dockerfile, and adding a line RUN pip install --no-binary=h5py h5py

Here is my Dockerfile

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get install -y pkg-config libhdf5-dev unzip graphviz curl musescore3 python3-pip 

RUN pip install --upgrade pip
RUN pip install --no-binary=h5py h5py

WORKDIR /app

COPY ./requirements.txt /app
RUN pip install -r /app/requirements.txt
RUN pip install tensorflow-io
RUN pip uninstall -y tensorflow-io

COPY /notebooks/. /app/notebooks
COPY /scripts/. /app/scripts

ENV PYTHONPATH="${PYTHONPATH}:/app"

@ethanwlx
Copy link

ethanwlx commented Jun 4, 2024

Experiencing the same issue on Mac (M3 Max). @DucHUNG312’s solution works.

@nileshmalpekar
Copy link

I fixed it by adding pkg-config and libhdf5-dev to the RUN apt-get install line in the Dockerfile and nothing else was changed.

@piovac
Copy link

piovac commented Jul 12, 2024

I have been able to make docker build and run the image properly just adding the line DOCKER_DEFAULT_PLATFORM=linux/amd64 to the .env file.

The issue I is the Jupyter kernel continuously die and restart when running some notebooks. For instance:

Kernel Restarting
The kernel for notebooks/02_deeplearning/02_cnn/cnn.ipynb appears to have died. It will restart automatically.

@THUrachel
Copy link

@DucHUNG312 You may also need to add
pip install --upgrade h5py to upgrade h5py to 3.11.0
Otherwise 2.10.0 h5py may conflict with default numpy version 1.24.4

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

6 participants