title: How to install python3.7 and create a virtualenv with pip on Ubuntu 18.04?
body: <p>I'm trying to set up a standard virtual-environment(venv) with python 3.7 on Ubuntu 18.04, with pip (or some way to install packages in the venv).  The standard way to install python3.7 seems to be:</p>
  <pre><code>% sudo apt install python3.7 python3.7-venv
  % python3.7 -m venv py37-venv
  </code></pre>
  <p>but the second command fails, saying:</p>
  <blockquote>
  <p>The virtual environment was not created successfully because ensurepip
  is not available.  On Debian/Ubuntu systems, you need to install the
  python3-venv package using the following command.</p>
  <pre><code>apt-get install python3-venv
  </code></pre>
  <p>You may need to use sudo with that command.  After installing the
  python3-venv package, recreate your virtual environment.</p>
  <p>Failing command: ['/py37-venv/bin/python3.7', '-Im', 'ensurepip',
  '--upgrade', '--default-pip']</p>
  </blockquote>
  <p>This is true; there is no ensurepip nor pip installed with this python. And I did install <code>python3.7-venv</code> already (<code>python3-venv</code> is for python3.6 on Debian/Ubuntu). I gather there has been some discussion about this in the python community because of multiple python versions and/or requiring root access, and alternate ways to install python modules via <code>apt</code> or similar.</p>
  <p>Creating a venv without pip (<code>--without-pip</code>) succeeds, but then there's no way to install packages in the new venv which seems to largely defeat the purpose.</p>
  <p>So what's the accepted &quot;best practice&quot; way to install and use python3.7 on 18.04 with a venv?</p>