title: pyenv BUILD FAILED while trying (pyenv install -v 3.9.0) on wsl2 ubuntu 20.04
body: <p>SOLVED: the solution was I needed zlib1g-dev</p>
  <p>This is the error pyenv produces</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;frozen zipimport&gt;&quot;, line 520, in _get_decompress_func
  ModuleNotFoundError: No module named 'zlib'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;&lt;frozen zipimport&gt;&quot;, line 568, in _get_data
    File &quot;&lt;frozen zipimport&gt;&quot;, line 523, in _get_decompress_func
  zipimport.ZipImportError: can't decompress data; zlib not available
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;&lt;string&gt;&quot;, line 6, in &lt;module&gt;
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/runpy.py&quot;, line 206, in run_module
      mod_name, mod_spec, code = _get_module_details(mod_name)
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/runpy.py&quot;, line 147, in _get_module_details
      return _get_module_details(pkg_main_name, error)
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/runpy.py&quot;, line 111, in _get_module_details
      __import__(pkg_name)
    File &quot;&lt;frozen zipimport&gt;&quot;, line 241, in load_module
    File &quot;&lt;frozen zipimport&gt;&quot;, line 709, in _get_module_code
    File &quot;&lt;frozen zipimport&gt;&quot;, line 570, in _get_data
  zipimport.ZipImportError: can't decompress data; zlib not available
  Traceback (most recent call last):
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/runpy.py&quot;, line 197, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/ensurepip/__main__.py&quot;, line 5, in &lt;module&gt;
      sys.exit(ensurepip._main())
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/ensurepip/__init__.py&quot;, line 210, in _main
      return _bootstrap(
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/ensurepip/__init__.py&quot;, line 129, in _bootstrap
      return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/ensurepip/__init__.py&quot;, line 38, in _run_pip
      return subprocess.run([sys.executable, &quot;-c&quot;, code], check=True).returncode
    File &quot;/tmp/python-build.20201212114143.1082/Python-3.9.0/Lib/subprocess.py&quot;, line 524, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['/tmp/python-build.20201212114143.1082/Python-3.9.0/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmpk898xfhs/setuptools-49.2.1-py3-none-any.whl\', \'/tmp/tmpk898xfhs/pip-20.2.3-py2.py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmpk898xfhs\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module(&quot;pip&quot;, run_name=&quot;__main__&quot;, alter_sys=True)\n']' returned non-zero exit status 1.
  make: *** [Makefile:1254: install] Error 1
  </code></pre>
  <p>I have found nothing on this when googling and have no idea what is going on.
  the steps that I have done are, first installing the pyenv installer and running that script then trying to run (pyenv install -v 3.9.0)</p>
  <p>the system does have python3.8 installed and pyenv does seem to know about it
  but it still will not let me install 3.9.0</p>
  <p>EDIT: I should also throw in that in order to let pyenv know about the system version of python I did this (sudo ln -s /usr/bin/python3 /usr/bin/python).
  Another thing is I also tried installing 3.9.0 with a tool called asdf and that resulted in the same error</p>
  <p>EDIT2: It seems like im missing zlib from the traceback but Im on ubuntu and do have zlib1g installed and from what I looked up thats what zlib is on ubuntu 20.04 im going to try and find more info on the zlib and see if I need to install something else</p>