Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
RUN apt-get -o upgrade -y
RUN apt-get -o install python3.7 -y
RUN apt-get -o install sudo -y
RUN sudo mkdir -p /tensorflow/models
RUN apt-get -o install -y git python-pip
RUN pip install --upgrade pip
RUN pip install tensorflow==1.14
But when i build the docker file it gets stuck on the
RUN pip install tensorflow==1.14
and it shows a warning message
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
and also, it got stuck with this process
Collecting tensorflow==1.14
Downloading tensorflow-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl (109.2 MB)
But the python version i've installed in my docker and in my local computer is 3.7.3. I dont understand why its using the 2.7 version. How do i go about making the docker use the 3.7 version of python? Since i want to install tensorflow with the 3.7 version
–
There are many ways to go around this issue. Even though you've installed python3.7, you have not installed a compatible version of pip.
To install pip that will work with python3, you should install python3-pip
package and the run pip3 install tensorflow==1.14
.
As suggested by others, you can build on top Python Docker image, e.g. FROM python:3.7.7
. In that case you don't even have to install pip & Python.
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.