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
/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
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_<user>
, and retry
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.
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/homebrew#33897.
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
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.
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).
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 Thanks for the feedback. PR #3611 created for this, I'll commit it once all the tests pass.
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.
The change should be in the next release of pip (whenever that gets released).
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.
This continues, with pip 9.0.1.
On Wed, 2017-01-18 16:08 -0800, matsaman notifications@github.com
wrote:
This continues, with pip 9.0.1.
At this stage I think the PyPA developers are having trouble coming up
with test cases to reproduce this. Can you give some detail on what to
do, in a fresh environment, to create this behaviour?
--
\
`\
_o__) Ben Finney
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.
macOS-related nonsense would not surprise me
No such luck—just tested on GNU/Linux & got the same problem.
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'
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.
Most helpful comment
This continues to occur.
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.