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 · 3 comments
Open

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

OneWind opened this issue Apr 19, 2024 · 3 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.

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

4 participants