Install Python Package in Docker File
In My Docker File, I Want to Install Med2Image Python Package (). I Use the Following Code: from Ubuntu:16.04 Run Apt-Get Update && Apt-Get Install -Y...
In my docker file, I want to install med2image python package (). I use the following code:
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.5 \
python3-pip \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install nibabel pydicom matplotlib pillow
RUN pip install med2image
But I get the following error when I want to build the image:
Downloading
Complete output from command python setup.py egg_info:
Sorry, only Python 3.5+ is supported.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-FnNb_S/med2image/
The command '/bin/sh -c pip install med2image' returned a non-zero code: 1
What should I do?!
4 Answers
Must Read
Recommended base image
As suggested in my comment, you could write a Dockerfile that looks like:
FROM python:3
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir nibabel pydicom matplotlib pillow && \
pip install --no-cache-dir med2image
CMD ["cat", "/etc/os-release"]
And the command example above could confirm at runtime (docker build --pull -t test . && docker run --rm -it test) that this image is based on the GNU/Linux distribution "Debian stable".