Docker add python and pandas

I have already read the guide on how to add python3 to container at this link

However, doing so if I try to install the pandas library from pip3, it gives errors during the installation phase.

How can I add another base image to the container already built to support python3 and pandas?
An image taken for example from the docker hub:Docker Hub

Or how can I generally correctly install external libraries like pandas?

Thanks so much

You can find the Dockerfile here. So you can copy it, create your own one with another base image which is also Alpine Linux based.

Or if you want to use another base image that is Debian based you can, use this one.

1 Like

Great thank you very much.
It is very convenient to have the dockerfile.
I could simply replace ubuntu as the base image and install python and the various libraries I need.

I noticed that there is already a debian-based image on your dockerhub, I used that as the base image.
The debian version not being the latest, it installed python 3.5 which was not compatible with the libraries I need.
So I updated it with the following command

RUN sed -i ā€˜s / stretch / buster / gā€™ /etc/apt/sources.list

(Even though he still installed me python version 3.7 and the latest)

Do you advise me to use the official version with debian from dockerhub, updating it as I did, or to use the docker file you linked to me and use the latest ubuntu LTS as a base image?
What can be the most stable solution?

Thanks so much

If you have a Debian base image with the correct Python version, you can set it as the base here and then build it.

1 Like