Explodes with python3-lxc Ubuntu package installed

Issue #358 on hold
stub42
created an issue

If sitepackages=True and the python3-lxc Ubuntu package is installed, tox fails with a lengthy and unhelpful traceback. Something about how this package installs the lxc or _lxc Python packages is causing things to fail during freeze.

test create: /home/ubuntu/charms/layers/telegraf/.tox/test
test installdeps: -r/home/ubuntu/charms/layers/telegraf/test_requirements.txt
ERROR: invocation failed (exit code 2), logfile: /home/ubuntu/charms/layers/telegraf/.tox/test/log/test-2.log
ERROR: actionid: test
msg: envreport
cmdargs: ['/home/ubuntu/charms/layers/telegraf/.tox/test/bin/pip', 'freeze']
env: {...}

Exception:
Traceback (most recent call last):
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/packaging/requirements.py", line 92, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1172, in parseString
    raise exc
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1162, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1028, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 2462, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1028, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 2719, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1028, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 2445, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1032, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pyparsing.py", line 1823, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected W:(abcd...) (at char 0), (line:1, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2788, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'-lxc==0.'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/commands/freeze.py", line 85, in run
    for line in freeze(**freeze_kwargs):
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/operations/freeze.py", line 47, in freeze
    dependency_links
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/__init__.py", line 264, in from_dist
    req = dist.as_requirement()
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2562, in as_requirement
    return Requirement.parse(spec)
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2833, in parse
    req, = parse_requirements(s)
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2781, in parse_requirements
    yield Requirement(line)
  File "/home/ubuntu/charms/layers/telegraf/.tox/test/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'-lxc==0.'"

Traceback (most recent call last):
  File "/usr/bin/tox", line 9, in <module>
    load_entry_point('tox==2.3.1', 'console_scripts', 'tox')()
  File "/usr/lib/python3/dist-packages/tox/session.py", line 39, in main
    retcode = Session(config).runcommand()
  File "/usr/lib/python3/dist-packages/tox/session.py", line 375, in runcommand
    return self.subcommand_test()
  File "/usr/lib/python3/dist-packages/tox/session.py", line 540, in subcommand_test
    action=action)
  File "/usr/lib/python3/dist-packages/tox/venv.py", line 362, in _pcall
    redirect=redirect, ignore_ret=ignore_ret)
  File "/usr/lib/python3/dist-packages/tox/session.py", line 193, in popen
    "%s (see %s)" % (invoked, outpath), ret)
tox.InvocationError: InvocationError: /home/ubuntu/charms/layers/telegraf/.tox/test/bin/pip freeze (see /home/ubuntu/charms/layers/telegraf/.tox/test/log/test-2.log)