oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.2k stars 104 forks source link

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'patch' #273

Closed limanhei closed 2 years ago

limanhei commented 2 years ago

I am trying to build my own image with numpy installed. However, I tried different base image but when I pip install numpy, I got this error : ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'patch' . Appreciate if you can advise what need to be done to fix. Thanks!

20220708_004525

16572167897735609897427574228635

msimacek commented 2 years ago

Could you please provide the Dockefile in a text form (not a screenshot)?

limanhei commented 2 years ago

FROM redhat/ubi8:latest

ENV JAVA_HOME /opt/graalvm-ce-java11-22.1.0 ENV PATH /opt/graalvm-ce-java11-22.1.0/bin:$PATH

RUN curl -SLO "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.1.0/graalvm-ce-java11-linux-amd64-22.1.0.tar.gz" \ && curl -SLO "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.1.0/llvm-toolchain-installable-java11-linux-amd64-22.1.0.jar" \ && curl -SLO "https://github.com/oracle/graalpython/releases/download/vm-22.1.0/python-installable-svm-java11-linux-amd64-22.1.0.jar" \ && tar -xf "graalvm-ce-java11-linux-amd64-22.1.0.tar.gz" -C /opt/ \ && gu -L install "llvm-toolchain-installable-java11-linux-amd64-22.1.0.jar" \ && gu -L install "python-installable-svm-java11-linux-amd64-22.1.0.jar" \ && rm "graalvm-ce-java11-linux-amd64-22.1.0.tar.gz" "llvm-toolchain-installable-java11-linux-amd64-22.1.0.jar" "python-installable-svm-java11-linux-amd64-22.1.0.jar" \ && graalpython -m venv pvenv \ && source pvenv/bin/activate \ && pip install numpy==1.16.4

msimacek commented 2 years ago

You need to have the patch utility installed so that graalpython can apply compatibility patches. You can do it by adding RUN dnf install patch to the Dockerfile. I'll try to change graalpython to print a better error message next time.

msimacek commented 2 years ago

numpy also seems to need the gcc package to build

limanhei commented 2 years ago

working now, thanks a lot