相关文章推荐
爱旅游的小虾米  ·  Installation from ...·  2 周前    · 
忐忑的马克杯  ·  pip ...·  2 周前    · 
踏实的佛珠  ·  pip intall 出现 error: ...·  1 周前    · 
慷慨大方的薯片  ·  recursive CTE seems ...·  7 月前    · 
要出家的台灯  ·  vue.js - npm ...·  1 年前    · 
小眼睛的椅子  ·  C++ ...·  1 年前    · 
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

@barnacle.m upvote a question if it "shows research effort; it is useful and clear". Vote on the post, not the score - see e.g. meta.stackoverflow.com/q/311406/3001761. – jonrsharpe May 18, 2020 at 14:47

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.

thank you for the detailed explanation. im new to creating dockerfiles, so it's completely okay to build on top of a python docker image than the one i'm using(the ubuntu base) ??? – void-louise May 18, 2020 at 13:31

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.