docker-robot-framework
docker-robot-framework copied to clipboard
How to install numpy / pandas
Hi,
can you please give some advise how to use your image and in addition also install numpy / pandas?
BTW, i 've read lots of statements saying that alpine is not the best choice for python based applications, e.g. because auf alpine's musl which is not supported by "standard wheel"...
I am not sure the use case of running numpy and pandas in a docker container used for running tests, but regardless you can just use this image as a base and do a pip install. Something like
RUN pip3 install \
--no-cache-dir \
numpy \
pandas \
I agree that alpine may not be best for heavily C based python packages but the intention is not to do a lot of non-testing C work in this docker image so i think the size advantage helps tests run faster.
We use robotframework-datadriver[XLS]
and this in turn has dependencies to these packages...
Unfortunately your idea does not work, even if i previously again install all those dependencies which are temporarily available when building your image. (gcc, make ...):
...
Successfully built numpy
Failed to build pandas
ERROR: Could not build wheels for pandas which use PEP 517 and cannot be installed directly
would need something like this:
RUN apk update \
&& apk --no-cache --virtual .build-deps add \
gcc \
libffi-dev \
linux-headers \
make \
musl-dev \
openssl-dev \
which \
wget \
# Install Robot Framework and Selenium Library
&& pip3 install \
--no-cache-dir \
numpy \
pandas \
&& apk del --no-cache --update-cache .build-deps
Hi thanks for your reply. Maybe i was a bit unclear, but your last suggestion was exactly what i have done and which still fails with the error message i posted in my previous comment.
But now i found that it was package "g++" which is additionally missing. Thanks for helping
Sure glad it worked, if you dont mind can you paste waht you did? It might be worth adding data driven test cases ability to the main image
Sure ;-) Both following builds take aprox. 20 minutes each
For numpy/pandas only:
FROM ppodgorsek/robot-framework:latest
USER root
## # Install system dependencies
RUN apk update \
&& apk --no-cache --virtual .build-deps add \
gcc \
g++ \
libffi-dev \
linux-headers \
make \
musl-dev \
openssl-dev \
which \
wget \
&& \
# Install Robot Framework and Selenium Library
pip3 install \
--no-cache-dir \
numpy \
pandas \
&& apk del --no-cache --update-cache .build-deps
USER ${ROBOT_UID}:${ROBOT_GID}
for robotframework-datadriver[XLS] (and numpy/pandas via dependencies)
FROM ppodgorsek/robot-framework:latest
USER root
## # Install system dependencies
RUN apk update \
&& apk --no-cache --virtual .build-deps add \
gcc \
g++ \
libffi-dev \
linux-headers \
make \
musl-dev \
openssl-dev \
which \
wget \
&& \
# Install Robot Framework and Selenium Library
pip3 install \
--no-cache-dir \
robotframework-datadriver[XLS] \
&& apk del --no-cache --update-cache .build-deps
USER ${ROBOT_UID}:${ROBOT_GID}