title: test_venv failed Python 3.6.1 install
body: <p>I've just installed Linux Mint 18.1 (so I'm new to Linux and I don't know what I'm doing!) and I'm attempting to install Python 3.6.1.
  However, one of the install tests keeps failing--test_venv.
  Here's the log:</p>
  
  <pre><code>running build
  running build_ext
  INFO: Can't locate Tcl/Tk libs and/or headers
  warning: building with the bundled copy of libffi is deprecated on this platform.  It will not be distributed with Python 3.7
  
  Python build finished successfully!
  The necessary bits to build these optional modules were not found:
  _bz2                  _curses               _curses_panel      
  _dbm                  _gdbm                 _lzma              
  _sqlite3              _ssl                  _tkinter           
  readline              zlib                                     
  To find the necessary bits, look in setup.py in detect_modules() for the module's name.
  
  The following modules found by detect_modules() in setup.py, have been
  built by the Makefile instead, as configured by the Setup files:
  atexit                pwd                   time               
  running build_scripts
  copying and adjusting /opt/Python-3.6.1/Tools/scripts/pydoc3 -&gt; build/scripts-3.6
  copying and adjusting /opt/Python-3.6.1/Tools/scripts/idle3 -&gt; build/scripts-3.6
  copying and adjusting /opt/Python-3.6.1/Tools/scripts/2to3 -&gt; build/scripts-3.6
  copying and adjusting /opt/Python-3.6.1/Tools/scripts/pyvenv -&gt; build/scripts-3.6
  changing mode of build/scripts-3.6/pydoc3 from 644 to 755
  changing mode of build/scripts-3.6/idle3 from 644 to 755
  changing mode of build/scripts-3.6/2to3 from 644 to 755
  changing mode of build/scripts-3.6/pyvenv from 644 to 755
  renaming build/scripts-3.6/pydoc3 to build/scripts-3.6/pydoc3.6
  renaming build/scripts-3.6/idle3 to build/scripts-3.6/idle3.6
  renaming build/scripts-3.6/2to3 to build/scripts-3.6/2to3-3.6
  renaming build/scripts-3.6/pyvenv to build/scripts-3.6/pyvenv-3.6
  ./python  ./Tools/scripts/run_tests.py -v test_venv
  /opt/Python-3.6.1/python -W default -bb -E -W error::BytesWarning -m test -r -w -j 0 -u all,-largefile,-audio,-gui -v test_venv
  == CPython 3.6.1 (default, Apr 16 2017, 09:33:09) [GCC 5.4.0 20160609]
  ==   Linux-4.4.0-53-generic-i686-athlon-with-debian-stretch-sid little-endian
  ==   hash algorithm: siphash24 32bit
  ==  cwd: /opt/Python-3.6.1/build/test_python_21688
  ==  encodings: locale=UTF-8, FS=utf-8
  Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=2, quiet=0, hash_randomization=1, isolated=0)
  Using random seed 8896684
  Run tests in parallel using 4 child processes
  0:00:03 [1/1/1] test_venv failed
  test_defaults (test.test_venv.BasicTest) ... ok
  test_executable (test.test_venv.BasicTest) ... ok
  test_executable_symlinks (test.test_venv.BasicTest) ... ok
  test_isolation (test.test_venv.BasicTest) ... ok
  test_overwrite_existing (test.test_venv.BasicTest) ... ok
  test_prefixes (test.test_venv.BasicTest) ... ok
  test_prompt (test.test_venv.BasicTest) ... ok
  test_symlinking (test.test_venv.BasicTest) ... ok
  test_unoverwritable_fails (test.test_venv.BasicTest) ... ok
  test_upgrade (test.test_venv.BasicTest) ... ok
  test_devnull (test.test_venv.EnsurePipTest) ... ok
  test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok
  test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok
  test_with_pip (test.test_venv.EnsurePipTest) ... FAIL
  
  ======================================================================
  FAIL: test_with_pip (test.test_venv.EnsurePipTest)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 368, in do_test_with_pip
      with_pip=True)
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 61, in run_with_capture
      func(*args, **kwargs)
  subprocess.CalledProcessError: Command '['/tmp/tmp75p27d_d/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 428, in test_with_pip
      self.do_test_with_pip(False)
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 374, in do_test_with_pip
      self.fail(msg.format(exc, details))
  AssertionError: Command '['/tmp/tmp75p27d_d/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
  
  **Subprocess Output**
  Traceback (most recent call last):
    File "/opt/Python-3.6.1/Lib/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/opt/Python-3.6.1/Lib/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/opt/Python-3.6.1/Lib/ensurepip/__main__.py", line 4, in &lt;module&gt;
      ensurepip._main()
    File "/opt/Python-3.6.1/Lib/ensurepip/__init__.py", line 189, in _main
      default_pip=args.default_pip,
    File "/opt/Python-3.6.1/Lib/ensurepip/__init__.py", line 102, in bootstrap
      _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
    File "/opt/Python-3.6.1/Lib/ensurepip/__init__.py", line 27, in _run_pip
      import pip
  zipimport.ZipImportError: can't decompress data; zlib not available
  
  
  ----------------------------------------------------------------------
  Ran 14 tests in 2.668s
  
  FAILED (failures=1)
  test test_venv failed
  
  1 test failed:
      test_venv
  Re-running failed tests in verbose mode
  Re-running test 'test_venv' in verbose mode
  test_defaults (test.test_venv.BasicTest) ... ok
  test_executable (test.test_venv.BasicTest) ... ok
  test_executable_symlinks (test.test_venv.BasicTest) ... ok
  test_isolation (test.test_venv.BasicTest) ... ok
  test_overwrite_existing (test.test_venv.BasicTest) ... ok
  test_prefixes (test.test_venv.BasicTest) ... ok
  test_prompt (test.test_venv.BasicTest) ... ok
  test_symlinking (test.test_venv.BasicTest) ... ok
  test_unoverwritable_fails (test.test_venv.BasicTest) ... ok
  test_upgrade (test.test_venv.BasicTest) ... ok
  test_devnull (test.test_venv.EnsurePipTest) ... ok
  test_explicit_no_pip (test.test_venv.EnsurePipTest) ... ok
  test_no_pip_by_default (test.test_venv.EnsurePipTest) ... ok
  test_with_pip (test.test_venv.EnsurePipTest) ... FAIL
  
  ======================================================================
  FAIL: test_with_pip (test.test_venv.EnsurePipTest)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 368, in do_test_with_pip
      with_pip=True)
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 61, in run_with_capture
      func(*args, **kwargs)
  subprocess.CalledProcessError: Command '['/tmp/tmp0zy9q1i8/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 428, in test_with_pip
      self.do_test_with_pip(False)
    File "/opt/Python-3.6.1/Lib/test/test_venv.py", line 374, in do_test_with_pip
      self.fail(msg.format(exc, details))
  AssertionError: Command '['/tmp/tmp0zy9q1i8/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
  
  **Subprocess Output**
  Traceback (most recent call last):
    File "/opt/Python-3.6.1/Lib/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/opt/Python-3.6.1/Lib/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/opt/Python-3.6.1/Lib/ensurepip/__main__.py", line 4, in &lt;module&gt;
      ensurepip._main()
    File "/opt/Python-3.6.1/Lib/ensurepip/__init__.py", line 189, in _main
      default_pip=args.default_pip,
    File "/opt/Python-3.6.1/Lib/ensurepip/__init__.py", line 102, in bootstrap
      _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
    File "/opt/Python-3.6.1/Lib/ensurepip/__init__.py", line 27, in _run_pip
      import pip
  zipimport.ZipImportError: can't decompress data; zlib not available
  
  
  ----------------------------------------------------------------------
  Ran 14 tests in 2.652s
  
  FAILED (failures=1)
  test test_venv failed
  1 test failed again:
      test_venv
  
  Total duration: 6 sec
  Tests result: FAILURE
  Makefile:1018: recipe for target 'test' failed
  make: *** [test] Error 1
  </code></pre>
  
  <p>There's a few things that may be going wrong--at the top it mentions the optional modules that were not found, but I can't figure out how to fix them. I tried installing them with pip, but I got more errors. I also tried looking in detect_modles() in setup.py, but I'm not sure what I'm supposed to do from there. Any pointers on where to go next?</p>