New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Multiple .dist-info directories #1964

Closed
ssbarnea opened this Issue Aug 7, 2014 · 17 comments

Comments

Projects
None yet
@ssbarnea
Contributor

ssbarnea commented Aug 7, 2014

The error is very confusing and doesn't include any hint on which is the real problem, which are the "multiple" ones, these are not listed even in the pip.log

pip install --user python3-ldap
Downloading/unpacking python3-ldap
  Downloading python3_ldap-0.9.5.2-py2.py3-none-any.whl (136kB): 136kB downloaded
Requirement already satisfied (use --upgrade to upgrade): pyasn1==0.1.7 in /Users/sorins/Library/Python/2.7/lib/python/site-packages (from python3-ldap)
Installing collected packages: python3-ldap
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Library/Python/2.7/site-packages/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/pip/req.py", line 671, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/Library/Python/2.7/site-packages/pip/req.py", line 901, in move_wheel_files
    pycompile=self.pycompile,
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 215, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 193, in clobber
    assert not info_dir, 'Multiple .dist-info directories'
AssertionError: Multiple .dist-info directories

Storing debug log for failure in /Users/sorins/Library/Logs/pip.log

http://pastebin.com/fqz89aUM

/Library/Python/2.7/site-packages $ ls -w
Jinja2-2.7.3-py2.7.egg-info     coverage-3.7.1-py2.7.egg-info       pip-1.5.6-py2.7.egg-info        pytest_pep8.py              sqlalchemy
MarkupSafe-0.23-py2.7.egg-info      docutils                py                  pytest_pep8.pyc             teamcity
Pygments-1.6-py2.7.egg-info     docutils-0.11-py2.7.egg-info        py-1.4.22-py2.7.egg-info        pytest_pycharm-0.1.0-py2.7.egg-info teamcity_messages-1.8-py2.7.egg-info
README                  easy-install.pth            pygments                pytest_pycharm.py           tlslite
SQLAlchemy-0.9.6-py2.7.egg-info     execnet                 pytest-2.6.0-py2.7.egg-info     pytest_pycharm.pyc          tlslite-0.4.6-py2.7.egg-info
Sphinx-1.2.2-py2.7.egg-info     execnet-1.2.0-py2.7.egg-info        pytest.py               pytest_xdist-1.10-py2.7.egg-info    vboxapi
_pytest                 jinja2                  pytest.pyc              requests                vboxapi-1.0-py2.7.egg-info
activedirectory-0.0.7-py2.7.egg-info    markupsafe              pytest_cache-1.0-py2.7.egg-info     requests-2.3.0.dist-info        virtualenv-1.11.6.dist-info
cov_core-1.13.0-py2.7.egg-info      pep8-1.5.7.dist-info            pytest_cache.py             requests_oauthlib           virtualenv.py
cov_core.py             pep8.py                 pytest_cache.pyc            requests_oauthlib-0.4.1.dist-info   virtualenv.pyc
cov_core.pyc                pep8.pyc                pytest_cov-1.7.0-py2.7.egg-info     six-1.7.2-py2.7.egg-info        virtualenv_support
cov_core_init.py            pg8000                  pytest_cov.py               six.py                  xdist
cov_core_init.pyc           pg8000-1.9.11-py2.7.egg-info        pytest_cov.pyc              six.pyc                 xmlrunner
coverage                pip                 pytest_pep8-1.0.6-py2.7.egg-info    sphinx                  xmlrunner-1.7.5-py2.7.egg-info
~/Library/Python/2.7/lib/python/site-packages $ ls -w
IPython                          filemagic-1.6-py2.7.egg-info     mock-1.0.1-py2.7.egg-info        pkg_resources.py                 readline.py                      tox-1.7.2-py2.7.egg-info
_markerlib                       gnureadline-6.3.3-py2.7.egg-info mock.py                          pkg_resources.pyc                readline.pyc                     wheel
autopep8-1.0.3-py2.7.egg-info    gnureadline.so                   mock.pyc                         pyasn1                           setuptools                       wheel-0.24.0.dist-info
autopep8.py                      ipython-2.1.0.dist-info          nose                             pyasn1-0.1.7-py2.7.egg-info      setuptools-5.4.1.dist-info       yanc
autopep8.pyc                     jira                             nose-1.3.3-py2.7.egg-info        pypyodbc-1.3.3-py2.7.egg-info    tendo                            yanc-0.2.4-py2.7.egg-info
easy_install.py                  jira-0.29.dist-info              oauthlib                         pypyodbc.py                      tendo-0.2.6-py2.7.egg-info
easy_install.pyc                 magic                            oauthlib-0.6.3-py2.7.egg-info    pypyodbc.pyc                     tox
@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Aug 8, 2014

Contributor

can you check for a global build dir? /tmp/pip_build_<user>/python3-ldap/
if it's there, delete the whole thing: ``/tmp/pip_build_`, and retry

Contributor

qwcode commented Aug 8, 2014

can you check for a global build dir? /tmp/pip_build_<user>/python3-ldap/
if it's there, delete the whole thing: ``/tmp/pip_build_`, and retry

@timitos

This comment has been minimized.

Show comment
Hide comment
@timitos

timitos Aug 14, 2014

I had this issue, too.

I looked for global build dirs and deleted them. I also had to delete an existing build directory under

~/.pip/build

After that the error disappeared.

timitos commented Aug 14, 2014

I had this issue, too.

I looked for global build dirs and deleted them. I also had to delete an existing build directory under

~/.pip/build

After that the error disappeared.

@tdsmith

This comment has been minimized.

Show comment
Hide comment
@tdsmith

tdsmith Nov 9, 2014

Contributor

Another possible directory pattern is like /private/var/folders/hy/l_6wd1ps0nz835v4g41zhhtr0000gn/T/pip_build. Leftover pip_build directories can cause ensurepip to fail, like in Homebrew/legacy-homebrew#33897.

Contributor

tdsmith commented Nov 9, 2014

Another possible directory pattern is like /private/var/folders/hy/l_6wd1ps0nz835v4g41zhhtr0000gn/T/pip_build. Leftover pip_build directories can cause ensurepip to fail, like in Homebrew/legacy-homebrew#33897.

@waltonryan

This comment has been minimized.

Show comment
Hide comment
@waltonryan

waltonryan May 19, 2015

I was able to solve the problem by using sudo. Here is what helped me but for installing django==1.6.5. http://stackoverflow.com/questions/20905350/latest-pip-fails-with-requires-setuptools-0-8-for-dist-info

waltonryan commented May 19, 2015

I was able to solve the problem by using sudo. Here is what helped me but for installing django==1.6.5. http://stackoverflow.com/questions/20905350/latest-pip-fails-with-requires-setuptools-0-8-for-dist-info

@bignose-debian

This comment has been minimized.

Show comment
Hide comment
@bignose-debian

bignose-debian Mar 31, 2016

This continues as a problem. As requested in the original report, please improve the error message to provide enough information (i.e. which are the “multiple” directories?) to allow the person seeing the message to address the problem.

bignose-debian commented Mar 31, 2016

This continues as a problem. As requested in the original report, please improve the error message to provide enough information (i.e. which are the “multiple” directories?) to allow the person seeing the message to address the problem.

@pfmoore

This comment has been minimized.

Show comment
Hide comment
@pfmoore

pfmoore Mar 31, 2016

Member

Can someone who is encountering the issue check if the following provides suitable information?

Change the assert line noted in the exception traceback to say:

    assert not info_dir, 'Multiple .dist-info directories: ' + destsubdir + ', ' + ', '.join(info_dir)

If you can confirm that the additional information is useful in fixing the issue, I'll make a PR adding that. (I've never seen the issue myself, so I can't reproduce it, or confirm whether the information the above change would provide is sufficient to help resolve the problem).

Member

pfmoore commented Mar 31, 2016

Can someone who is encountering the issue check if the following provides suitable information?

Change the assert line noted in the exception traceback to say:

    assert not info_dir, 'Multiple .dist-info directories: ' + destsubdir + ', ' + ', '.join(info_dir)

If you can confirm that the additional information is useful in fixing the issue, I'll make a PR adding that. (I've never seen the issue myself, so I can't reproduce it, or confirm whether the information the above change would provide is sufficient to help resolve the problem).

@kraney

This comment has been minimized.

Show comment
Hide comment
@kraney

kraney Apr 8, 2016

I found the information helpful on my mac, where the problem build directory is in a tempdir with a long hash for a name. Difficult to find otherwise.

kraney commented Apr 8, 2016

I found the information helpful on my mac, where the problem build directory is in a tempdir with a long hash for a name. Difficult to find otherwise.

@pfmoore

This comment has been minimized.

Show comment
Hide comment
@pfmoore

pfmoore Apr 11, 2016

Member

@kraney Thanks for the feedback. PR #3611 created for this, I'll commit it once all the tests pass.

Member

pfmoore commented Apr 11, 2016

@kraney Thanks for the feedback. PR #3611 created for this, I'll commit it once all the tests pass.

@andreacassioli

This comment has been minimized.

Show comment
Hide comment
@andreacassioli

andreacassioli Apr 13, 2016

I hope the error message will get better! I was absolutely clueless on where should I look for. It took me a while to clean all the mess and find what to delete.

andreacassioli commented Apr 13, 2016

I hope the error message will get better! I was absolutely clueless on where should I look for. It took me a while to clean all the mess and find what to delete.

@pfmoore

This comment has been minimized.

Show comment
Hide comment
@pfmoore

pfmoore Apr 13, 2016

Member

The change should be in the next release of pip (whenever that gets released).

Member

pfmoore commented Apr 13, 2016

The change should be in the next release of pip (whenever that gets released).

@bignose-debian

This comment has been minimized.

Show comment
Hide comment
@bignose-debian

bignose-debian Oct 8, 2016

This continues to occur.

$ python2 -m pip --version
pip 8.1.2 from /usr/lib/python2.7/dist-packages (python 2.7)
$ python2 -m virtualenv --version
15.0.3

$ VENV="$(mktemp -d)"
$ python2 -m virtualenv "$VENV"
[…]
Installing collected packages: setuptools, pkg-resources, pip, wheel
Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/pip-8.1.2-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  […]
  File "/usr/share/python-wheels/pip-8.1.2-py2.py3-none-any.whl/pip/wheel.py", line 306, in clobber
    ', '.join(info_dir))
AssertionError: Multiple .dist-info directories: /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-28.3.0.dist-info, /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-25.1.6.dist-info
[…]

$ ls /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-28.3.0.dist-info
ls: cannot access '/tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-28.3.0.dist-info': No such file or directory
$ ls /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-25.1.6.dist-info
ls: cannot access '/tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-25.1.6.dist-info': No such file or directory

As you can see, in Pip version 8.1.2, it complains about “multiple .dist-info directories” that didn't exist before the command, and don't exist afterward.

Full session output for the above demonstration.

bignose-debian commented Oct 8, 2016

This continues to occur.

$ python2 -m pip --version
pip 8.1.2 from /usr/lib/python2.7/dist-packages (python 2.7)
$ python2 -m virtualenv --version
15.0.3

$ VENV="$(mktemp -d)"
$ python2 -m virtualenv "$VENV"
[…]
Installing collected packages: setuptools, pkg-resources, pip, wheel
Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/pip-8.1.2-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  […]
  File "/usr/share/python-wheels/pip-8.1.2-py2.py3-none-any.whl/pip/wheel.py", line 306, in clobber
    ', '.join(info_dir))
AssertionError: Multiple .dist-info directories: /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-28.3.0.dist-info, /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-25.1.6.dist-info
[…]

$ ls /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-28.3.0.dist-info
ls: cannot access '/tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-28.3.0.dist-info': No such file or directory
$ ls /tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-25.1.6.dist-info
ls: cannot access '/tmp/tmp.hMBSljwiON/lib/python2.7/site-packages/setuptools-25.1.6.dist-info': No such file or directory

As you can see, in Pip version 8.1.2, it complains about “multiple .dist-info directories” that didn't exist before the command, and don't exist afterward.

Full session output for the above demonstration.

@matsaman

This comment has been minimized.

Show comment
Hide comment
@matsaman

matsaman Jan 19, 2017

This continues, with pip 9.0.1.

matsaman commented Jan 19, 2017

This continues, with pip 9.0.1.

@bignose-debian

This comment has been minimized.

Show comment
Hide comment
@bignose-debian

bignose-debian Jan 19, 2017

bignose-debian commented Jan 19, 2017

@matsaman

This comment has been minimized.

Show comment
Hide comment
@matsaman

matsaman Jan 19, 2017

Script started on Thu Jan 19 15:03:31 2017
$ uname -a
Darwin topsecret.local 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64 i386 iMac12,2 Darwin
$ which pip; pip --version
//usr/local/bin/pip
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
$ which python; python --version
//usr/local/bin/python
Python 2.7.12
$ virtualenv -p $(which python) ./venv
Running virtualenv with interpreter //usr/local/bin/python
New python executable in /Users/matsaman/test/venv/bin/python2.7
Also creating executable in /Users/matsaman/test/venv/bin/python
Installing setuptools, pip, wheel...done.
$ source ./venv/bin/activate
(venv)
$ which pip; pip --version
/Users/matsaman/test/venv/bin/pip
pip 9.0.1 from /Users/matsaman/test/venv/lib/python2.7/site-packages (python 2.7)
(venv)
$ which python; python --version
/Users/matsaman/test/venv/bin/python
Python 2.7.12
(venv)
$ pip install django-bitly==
Collecting django-bitly==
  Could not find a version that satisfies the requirement django-bitly== (from versions: 0.5, 0.5.1, 0.6, 0.7, 0.9, 0.10, 0.11.0, 0.12.0)
No matching distribution found for django-bitly==
(venv)
$ pip install django-bitly==0.12.0
Collecting django-bitly==0.12.0
  Using cached django_bitly-0.12.0-py2.py3-none-any.whl
Collecting django>=1.8 (from django-bitly==0.12.0)
  Using cached Django-1.10.5-py2.py3-none-any.whl
Collecting six (from django-bitly==0.12.0)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: django, six, django-bitly
Exception:
Traceback (most recent call last):
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/wheel.py", line 305, in clobber
    ', '.join(info_dir))
AssertionError: Multiple .dist-info directories: /Users/matsaman/test/venv/lib/python2.7/site-packages/django_bitly-0.12.0.dist-info, /Users/matsaman/test/venv/lib/python2.7/site-packages/django_bitly-0.11.0.dist-info
(venv)
$ exit
Script done on Thu Jan 19 15:05:26 2017

Some macOS-related nonsense would not surprise me at all, but that is occasionally the environment one is stuck with.

matsaman commented Jan 19, 2017

Script started on Thu Jan 19 15:03:31 2017
$ uname -a
Darwin topsecret.local 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64 i386 iMac12,2 Darwin
$ which pip; pip --version
//usr/local/bin/pip
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
$ which python; python --version
//usr/local/bin/python
Python 2.7.12
$ virtualenv -p $(which python) ./venv
Running virtualenv with interpreter //usr/local/bin/python
New python executable in /Users/matsaman/test/venv/bin/python2.7
Also creating executable in /Users/matsaman/test/venv/bin/python
Installing setuptools, pip, wheel...done.
$ source ./venv/bin/activate
(venv)
$ which pip; pip --version
/Users/matsaman/test/venv/bin/pip
pip 9.0.1 from /Users/matsaman/test/venv/lib/python2.7/site-packages (python 2.7)
(venv)
$ which python; python --version
/Users/matsaman/test/venv/bin/python
Python 2.7.12
(venv)
$ pip install django-bitly==
Collecting django-bitly==
  Could not find a version that satisfies the requirement django-bitly== (from versions: 0.5, 0.5.1, 0.6, 0.7, 0.9, 0.10, 0.11.0, 0.12.0)
No matching distribution found for django-bitly==
(venv)
$ pip install django-bitly==0.12.0
Collecting django-bitly==0.12.0
  Using cached django_bitly-0.12.0-py2.py3-none-any.whl
Collecting django>=1.8 (from django-bitly==0.12.0)
  Using cached Django-1.10.5-py2.py3-none-any.whl
Collecting six (from django-bitly==0.12.0)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: django, six, django-bitly
Exception:
Traceback (most recent call last):
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Users/matsaman/test/venv/lib/python2.7/site-packages/pip/wheel.py", line 305, in clobber
    ', '.join(info_dir))
AssertionError: Multiple .dist-info directories: /Users/matsaman/test/venv/lib/python2.7/site-packages/django_bitly-0.12.0.dist-info, /Users/matsaman/test/venv/lib/python2.7/site-packages/django_bitly-0.11.0.dist-info
(venv)
$ exit
Script done on Thu Jan 19 15:05:26 2017

Some macOS-related nonsense would not surprise me at all, but that is occasionally the environment one is stuck with.

@matsaman

This comment has been minimized.

Show comment
Hide comment
@matsaman

matsaman Jan 21, 2017

macOS-related nonsense would not surprise me

No such luck—just tested on GNU/Linux & got the same problem.

matsaman commented Jan 21, 2017

macOS-related nonsense would not surprise me

No such luck—just tested on GNU/Linux & got the same problem.

@matsaman

This comment has been minimized.

Show comment
Hide comment
@matsaman

matsaman Jan 26, 2017

Interestingly, pointing pip install to the 0.12.0 tarball at https://pypi.python.org/pypi/django-bitly works without issue.

That is: this fails...

pip install django-bitly==0.12.0

...but this does not fail...

pip install 'https://pypi.python.org/packages/f6/8d/56377cf570d9436c556660da642489e98986a729885281132a854bebd853/django-bitly-0.12.0.tar.gz#md5=f496a2fd2b40807f87512c6993aff700'

matsaman commented Jan 26, 2017

Interestingly, pointing pip install to the 0.12.0 tarball at https://pypi.python.org/pypi/django-bitly works without issue.

That is: this fails...

pip install django-bitly==0.12.0

...but this does not fail...

pip install 'https://pypi.python.org/packages/f6/8d/56377cf570d9436c556660da642489e98986a729885281132a854bebd853/django-bitly-0.12.0.tar.gz#md5=f496a2fd2b40807f87512c6993aff700'

@xavfernandez

This comment has been minimized.

Show comment
Hide comment
@xavfernandez

xavfernandez Jan 26, 2017

Contributor

Well, if you open the django_bitly-0.12.0-py2.py3-none-any.whl wheel from https://pypi.org/simple/django-bitly/ you can see there are two *.dist-info directory.
So this is an issue with the django-bitly package.

Contributor

xavfernandez commented Jan 26, 2017

Well, if you open the django_bitly-0.12.0-py2.py3-none-any.whl wheel from https://pypi.org/simple/django-bitly/ you can see there are two *.dist-info directory.
So this is an issue with the django-bitly package.

@matsaman matsaman referenced this issue Jan 27, 2017

Closed

Broken whl? #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment