Closed hirasso closed 2 years ago
I was able to install the dependencies manually like so:
$ brew install python@3.9
$ brew install pillow
$ brew install numpy
$ brew install --cask hugin
$ pip3 install --user pyshtools
Additional Steps
$ export PATH="/Applications/Hugin/PTBatcherGUI.app/Contents/MacOS:$PATH"
But I still would like to know how to get it to work with Docker...
If I deactivate pyshtools like this:
# RUN pip3 install pyshtools
...the Docker build passes, but of course the shtHashes won't be generated.
The Dockerfile assumes that pyshtools
will be installed as a binary Wheel. However, PyPI only has Wheels for x86_64, so installation on Arm requires building from source, which requires additional dependencies. Per the pyshtools
documentation, adding gcc gfortran libfftw3-dev libblas-dev liblapack-dev
to the end of the apt-get install
line should install the dependencies required for building from source.
WOW @mpetroff , that worked!!! I changed my Dockerfile as follows:
FROM ubuntu:20.04
# docker build -t generate-panorama .
# docker run -it -v $PWD:/data generate-panorama /data/image.jpg
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-dev python3-numpy python3-pip python3-pil hugin-tools \
gcc gfortran libfftw3-dev libblas-dev liblapack-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install pyshtools --no-binary pyshtools
ADD generate.py /generate.py
ENTRYPOINT ["python3", "/generate.py"]
Thank you so much for your fast help!
I guess the ideal solution would be to check if a binary wheel exists for pyshtools
for the architecture Docker is being run on. If it exists, the wheel should be installed. If not, the additional distro packages should be installed, and pyshtools
should then be built from the source package. Unfortunately, there doesn't seem to be a good way to check this with pip
. If pyshtools
started uploading binary wheels for Arm, that would also solve this issue.
Hi @mpetroff , I tried @hirasso solution on my mac m1, and getting the following error:
Collecting pyshtools Downloading pyshtools-4.11.10.tar.gz (41.5 MB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Installing backend dependencies: started Installing backend dependencies: finished with status 'done' Preparing wheel metadata: started Preparing wheel metadata: finished with status 'error' ERROR: Command errored out with exit status 1: command: /usr/bin/python3 /tmp/tmp4ewa_eo9 prepare_metadata_for_build_wheel /tmp/tmp7uyhowwi cwd: /tmp/pip-install-k33pyqxz/pyshtools Complete output (30 lines):
../meson.build:15:9: ERROR: Dependency lookup for BLAS with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.
@cyango I think you ran into the same issue that is described in #1205.
I just made some updates to the Dockerfile in 9beb4184e34dc0073ab35bbebf0eba9eac1d4e86 and badf8812c39aaf515e6a8aa2f5f034331b33aa18, and with these updates, it will hopefully just work.
It fixed it, thanks!
Hi there, what a great project. Thank you!!
I am on an M1 MacbookPro and am trying to use Docker (
version 20.10.11, build dea9396
) to make theutils/multires/generate.py
script work. When runningdocker build -t generate-panorama .
as instructed, I get the following error from Docker (sorry, a lot of info):The Docker container is not being built.
Any Idea? Maybe the Docker GitHub would be a better place to post this issue?