Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install scikit-learn, pandas and numpy in a docker image?

I am doing a project using the PySEAL library. My project is Machine Learning related so I want to use scikit-learn, pandas and numpy libraries. How can I install these libraries so that I can use them in PySEAL docker container's code?

like image 763
Whittaker Avatar asked Jul 09 '19 17:07

Whittaker


People also ask

How do I install Python packages in docker?

To install packages in a docker container, the packages should be defined in the Dockerfile. If you want to install packages in the Container, use the RUN statement followed by exact download command . You can update the Dockerfile with latest list of packages at anytime and build again to create new image out of it.

Can I install Python in a docker container?

There are essentially 5 steps:Create your python program (skip if you already have a Python program code) Create a docker file. Build the docker file into an image. Run the docker image in a container.

Can we install scikit-learn using pip?

Using such an isolated environment makes it possible to install a specific version of scikit-learn with pip or conda and its dependencies independently of any previously installed Python packages.


1 Answers

Simply add numpy and scikit-learn to PySEAL's requirements file.

Your final requirements file should be:

pybind11
cppimport
jupyter
numpy
scikit-learn

And run build-docker.sh again.

like image 94
mbrg Avatar answered Oct 03 '22 07:10

mbrg