Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
284 views
in Technique[技术] by (71.8m points)

Python 3.7 on Ubuntu 20.04

I am preparing a docker image for Ubuntu 20.04 and due to TensorFlow 2.0 requirement, I need Python 3.7. TensorFlow runs on Python 3.5 to 3.7. Running apt install python3 installs Python 3.8 by default and that breaks my TensorFlow installation.

Is there any way I can get an apt package for Python 3.7 for Ubuntu 20.04? Since it is going to be inside docker image, I don't want to get into the business of downloading Python 3.7 source code and compiling. Putting those commands in Dockerfile will be overwhelming for me. Is there any simpler way of getting Python 3.7 for Ubuntu 20.04?

Running

sudo apt-cache madison python3

returns

python3 | 3.8.2-0ubuntu2 | http://in.archive.ubuntu.com/ubuntu focal/main amd64 Packages
question from:https://stackoverflow.com/questions/61430166/python-3-7-on-ubuntu-20-04

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do you need Ubuntu 20.04? Ubuntu 18.04 comes with Python 3.6, and 3.7 available.

If you do, the deadsnakes PPA has Python 3.5-3.7 for Ubuntu 20.04 (Focal). To add it and install:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.7

P.s. I'm not a dev and have no experience with Tensorflow so take this with a grain of salt.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...