I was trying to build a docker image of "nestle-acne-assessment", unfortunately, I am facing an issue with the Python3 invalid syntax error.
Here's the Dockerfile:
FROM mcr.microsoft.com/cntk/release:2.5.1-cpu-python3.5
RUN dpkg --add-architecture i386 \
&& apt-get update && apt-get install -y \
build-essential \
git \
python3-pip \
python3-tk \
libglib2.0-0:i386 \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade pip
RUN pip3 install -U scikit-learn
RUN pip3 install numpy pandas sklearn matplotlib
RUN pip3 install scipy
RUN pip3 install opencv-python-headless
RUN pip3 install dlib
RUN pip3 install scikit-image
RUN pip3 install matplotlib
RUN pip3 install cntk
RUN pip3 install \
flask \
pillow
RUN mkdir /usr/src/nestle
WORKDIR /workspace
RUN chmod -R a+w /workspace
ADD ../models /workspace/models
COPY main.py /workspace
COPY regressionModel.py /workspace
COPY getPatches.py /workspace
COPY model.py /workspace
RUN chmod +x /workspace/main.py
RUN ls /workspace
CMD python3 /workspace/main.py
EXPOSE 9580
The error starts at RUN pip3 install -U scikit-learn
.
The error:
=> ERROR [ 4/22] RUN pip3 install -U scikit-learn 0.6s
------
> [ 4/22] RUN pip3 install -U scikit-learn:
#7 0.576 Traceback (most recent call last):
#7 0.576 File "/usr/local/bin/pip3", line 7, in <module>
#7 0.576 from pip._internal.cli.main import main
#7 0.576 File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57
#7 0.576 sys.stderr.write(f"ERROR: {exc}")
#7 0.576 ^
#7 0.576 SyntaxError: invalid syntax
------
executor failed running [/bin/sh -c pip3 install -U scikit-learn]: exit code: 1
I already tried to change the architecture to amd64
but it did not resolve the issue.
Please help me. Thank you.