[TIP] Initial ‘tox’ invocation fails: “AssertionError: Multiple .dist-info directories”

Marius Gedminas marius at gedmin.as
Tue Mar 22 23:36:20 PDT 2016

On Wed, Mar 23, 2016 at 05:19:49PM +1100, Ben Finney wrote:
> Having installed ‘tox’ (version 2.3.1, which is the version in Debian
> Stretch now), I make a ‘tox.ini’ file:
> Then when I run ‘tox’ in the same directory, it fails to set up the
> virtualenv:
> =====
> $ tox
> […]
> py35 create: /home/bignose/Projects/python/manpage/trunk/.tox/py35
> ERROR: invocation failed (exit code 1), logfile: /home/bignose/Projects/python/manpage/trunk/.tox/py35/log/py35-0.log
> ERROR: actionid: py35
> msg: getenv
> cmdargs: ['/usr/bin/python3', '-m', 'virtualenv', '--python', '/usr/bin/python3.5', 'py35']
> env: […]
> Using base prefix '/usr'
> New python executable in py35/bin/python3.5
> Also creating executable in py35/bin/python
> Please make sure you remove any previous custom paths from your /home/bignose/.pydistutils.cfg file.
> Installing setuptools, pip...
>   Complete output from command /home/bignose/Projec...x/py35/bin/python3.5 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
>   DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated.  See https://github.com/pypa/pip/issues/906.
> Ignoring indexes: https://pypi.python.org/simple/
> Downloading/unpacking setuptools
> Downloading/unpacking pip
> Installing collected packages: setuptools, pip
> Cleaning up...
> Exception:
> Traceback (most recent call last):
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/basecommand.py", line 122, in main
>     status = self.run(options, args)
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/commands/install.py", line 295, in run
>     requirement_set.install(install_options, global_options, root=options.root_path)
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/req.py", line 1436, in install
>     requirement.install(install_options, global_options, *args, **kwargs)
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/req.py", line 672, in install
>     self.move_wheel_files(self.source_dir, root=root)
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/req.py", line 902, in move_wheel_files
>     pycompile=self.pycompile,
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/wheel.py", line 214, in move_wheel_files
>     clobber(source, lib_dir, True)
>   File "/usr/share/python-wheels/pip-1.5.6-py2.py3-none-any.whl/pip/wheel.py", line 192, in clobber
>     assert not info_dir, 'Multiple .dist-info directories'
> AssertionError: Multiple .dist-info directories
> Storing debug log for failure in /home/bignose/.pip/pip.log
> ----------------------------------------
> ...Installing setuptools, pip...done.
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/virtualenv.py", line 2378, in <module>
>     main()
>   File "/usr/lib/python3/dist-packages/virtualenv.py", line 830, in main
>     symlink=options.symlink)
>   File "/usr/lib/python3/dist-packages/virtualenv.py", line 1032, in create_environment
>     install_wheel(to_install, py_executable, search_dirs)
>   File "/usr/lib/python3/dist-packages/virtualenv.py", line 975, in install_wheel
>     'PIP_NO_INDEX': '1'
>   File "/usr/lib/python3/dist-packages/virtualenv.py", line 917, in call_subprocess
>     % (cmd_desc, proc.returncode))
> OSError: Command /home/bignose/Projec...x/py35/bin/python3.5 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 2
> Running virtualenv with interpreter /usr/bin/python3.5
> ERROR: InvocationError: /usr/bin/python3 -m virtualenv --python /usr/bin/python3.5 py35 (see /home/bignose/Projects/python/manpage/trunk/.tox/py35/log/py35-0.log)
> =====
> Nothing in the “Basic example” or the issue tracker gives me any clues
> about this.
> What is wrong here? What needs to be done to get this working with the
> Debian-installed ‘tox’ package?

Are you sure it's a tox problem?  What happens if you try to create the
python3.5 virtualenv directly, outside tox?

I seem to remember that virtualenv had to be updated to work with Python
3.5, even if I don't remember seeing this particular error before.
What version of virtualenv do you have?

Can you try to upgrade virtualenv (perhaps with pip install --user virtualenv,
plus whatever -U/-I options required to convince pip to get a new
version without touching existing versions in /usr/lib/python*) and see
if that fixes your problem?

Marius Gedminas
/* Halley */

        (Halley's comment.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 173 bytes
Desc: Digital signature
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20160323/d28cba3f/attachment.pgp>

More information about the testing-in-python mailing list