title: how to install python 3.8 in Ubuntu virtualenv from source file (.tgz)
body: <p>I cannot install packages using <code>pip install &lt;packagename&gt;</code> because I am behind the security wall.</p>
  <p>I need to install python 3.8 in Ubuntu 16.04 server's virtualenv which originally has python 3.5.2</p>
  <p>For that, I manually installed <code>virtualenv-20.0.28-py2.py3-none-any.whl</code> on the server after (manually) installing all its dependencies. Then I created a virtualenv by <code>virtualenv pytorch</code> (<em><strong>pytorch</strong></em> is the name of virtual env) and activated it by <code>source pytorch/bin/activate</code>.</p>
  <p>Now I am in the env mode</p>
  <p><em><strong>(pytorch) user@ubuntu:~/my_packages$</strong></em></p>
  <p>when I did <code> pip install Python-3.8.0.tgz</code> it output the below error:</p>
  <pre><code>Processing ./Python-3.8.0.tgz
  ERROR: Command errored out with exit status 1:
   command: /home/user/my_packages/pytorch/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-req-build-9npp4vja/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-req-build-9npp4vja/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' egg_info --egg-base /tmp/pip-pip-egg-info-1d52yt0i
       cwd: /tmp/pip-req-build-9npp4vja/
  Complete output (9 lines):
  Traceback (most recent call last):
    File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
    File &quot;/tmp/pip-req-build-9npp4vja/setup.py&quot;, line 2433, in &lt;module&gt;
      main()
    File &quot;/tmp/pip-req-build-9npp4vja/setup.py&quot;, line 2392, in main
      set_compiler_flags('LDFLAGS', 'PY_LDFLAGS_NODIST')
    File &quot;/tmp/pip-req-build-9npp4vja/setup.py&quot;, line 85, in set_compiler_flags
      sysconfig.get_config_vars()[compiler_flags] = flags + ' ' + py_flags_nodist
  TypeError: Can't convert 'NoneType' object to str implicitly
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  </code></pre>
  <p>How do I install python 3.8 onto <em><strong>pytorch</strong></em> environment?</p>
  <p><strong>Note</strong> that I can only install packages manually</p>