Why does virtualenv effectively disable Python 3 tab-completion?

This is how I got my tab-completion back:

Added the following to ~/.pythonrc.py:

try:
    import readline
except ImportError:
    print("Module readline not available.")
else:
    import rlcompleter
    readline.parse_and_bind("tab: complete")

Added the following to ~/.bash_profile:

export PYTHONSTARTUP=$HOME/.pythonrc.py

Quoting Carl Meyer on this GitHub comment,

Yes, one of the uglier aspects of virtualenv's implementation is that it has to have its own copy of the site module, which is used for all virtualenvs regardless of which version of Python they are created with.

The problem is in the $VIRTUAL_ENV/lib/python3.4/site.py file, which does not setup tab completion. It does not provide the enablerlcompleter function. Compare it with the site.py file distributed with Python 3.

If you're using Python 3.3 or newer, I advise pyvenv instead of virtualenv.

python3 -mvenv ~/venv3.site

Another thing you could do is roll your own Python startup script and refer to it in the PYTHONSTARTUP environment variable. Put tab completion and other startup tweaks in there. See Mike Covington's answer for an example of such script.