The Python Oracle

How to install python3.7 and create a virtualenv with pip on Ubuntu 18.04?

This video explains
How to install python3.7 and create a virtualenv with pip on Ubuntu 18.04?

--

Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Ancient Construction

--

Chapters
00:00 Question
02:04 Accepted answer (Score 76)
02:44 Answer 2 (Score -7)
02:54 Thank you

--

Full question
https://stackoverflow.com/questions/5307...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pip #python37 #ubuntu1804 #pythonvenv

#avk47



ACCEPTED ANSWER

Score 80


I don't know if it's best practices or not, but if I also install python3-venv and python3.7-venv then everything works (this is tested on a fresh stock Debian buster docker image):

% sudo apt install python3.7 python3-venv python3.7-venv
% python3.7 -m venv py37-venv
% . py37-venv/bin/activate
(py37-venv) % 

Note that it also installs all of python3.6 needlessly, so I can't exactly say I like it, but at least it does work and doesn't require running an unsigned script the way get-pip.py does.