I try to run container from image nvcr.io/nvidia/tensorflow:22.08-tf2-py3
. But I have a problem.
The built docker-image contains python3.8. But I don’t understand why I have this version of python in my docker-image. It is necessary to use python with version>=3.10 for correct work with libraries that I need. Version=3.8 is not explicitly specified in Dockerfile. When I try to install an another version:
RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get install -y python3.11
RUN python3.11 -m pip install --upgrade --no-cache -r requirements.txt
I get an error /usr/bin/python3.11: No module named pip
during image building.
How can I correctly install specific version of python in my docker-image using Dockerfile?
2
Answers
You got Python 3.11 alright but you are missing the PIP module. Add
python-pip
orpython3-pip
to the list of packages you install withapt-get
.This is regarding your problem with python3.11 pip and not the tensor version support
Looking at the original python3.11 docker in here you should be able to use the bellow code.
I was able to install pip for my python3.11 on Fedora(outside Docker) using
python3 -m ensurepip
(taken from here)