google-cloud-python icon indicating copy to clipboard operation
google-cloud-python copied to clipboard

Failing pip install: distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')

Open RjLi13 opened this issue 9 years ago • 14 comments

Currently having trouble trying to pip install google-cloud on my Mac. As soon as it gets to trying to install tenacity it runs into issues.

OS: OS X Sierra 10.12.6. Python Version: 2.7.13 Pip version: 9.0.1 setuptools version: 36.2.7

Under company proxy but added proxy parameter and have installed other python packages using pip.

Stacktrace here:

  Using cached tenacity-4.4.0.tar.gz
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/pbr/: [Errno 65] No route to host -- Some packages may not be found!
    Couldn't find index page for 'pbr' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [Errno 65] No route to host -- Some packages may not be found!
    No local packages or working download links found for pbr
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/3r/y9rhgvvn1k9516sy_qj9p5m0g3s721/T/pip-build-QVdL3t/tenacity/setup.py", line 20, in <module>
        pbr=True)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/dist.py", line 325, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/dist.py", line 446, in fetch_build_eggs
        replace_conflicting=True,
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 855, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1127, in best_match
        return self.obtain(req, installer)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1139, in obtain
        return installer(requirement)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/dist.py", line 518, in fetch_build_egg
        return cmd.easy_install(req)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 666, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3r/y9rhgvvn1k9516sy_qj9p5m0g3s721/T/pip-build-QVdL3t/tenacity/ 

RjLi13 avatar Aug 08 '17 17:08 RjLi13

~Can you pip install --upgrade setuptools and see if that helps?~

Nevermind, that is my canned response to this stuff, but seems to be unrelated to your issue.

lukesneeringer avatar Aug 08 '17 17:08 lukesneeringer

This looks like an issue with your company proxy. pbr exists on PyPI, and there is not a whole lot we can do for you if you are unable to pull down dependencies. Sorry. :-/

lukesneeringer avatar Aug 08 '17 17:08 lukesneeringer

You could also try setting the HTTP_PROXY and HTTPS_PROXY if you haven't already https://www.jacobtomlinson.co.uk/2014/11/25/easy-install-and-pip-through-a-proxy/

theacodes avatar Aug 08 '17 17:08 theacodes

Hey, I can actually hit the pbr site on my browser, if that's the case could I download the pbr package somewhere and have pip continue using that?

I think it is a proxy issue though so I'm continuing to try to figure out my proxy settings. Thanks!

RjLi13 avatar Aug 08 '17 17:08 RjLi13

Yep - you can download the source distribution (zip) and just pip install zip then try re-installing these packages.

theacodes avatar Aug 08 '17 17:08 theacodes

Well interesting enough I managed to get past the issue by doing pip install pbr and installing that dependency separately, then continuing my install of google-cloud. Not sure why it couldn't hit the pbr website when installing google-cloud, but whatever!

RjLi13 avatar Aug 08 '17 17:08 RjLi13

For the information of other people who may happen on the problem (this page is top-ranked on google for "distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse": when running pip install, the installation of second-level requirements may be done by an older method with different behavior (easy_install) than the primarily requested packages. Look above your error "Traceback" for confirmation of the different behavior and just above the DistutilsError for a mention of easy_install.

If this is indeed the problem, then doing an explicit pip install of the not-found packages will solve it. Adding the package to the top of requirements.txt may be a useful workaround.

LorensK avatar Sep 18 '18 13:09 LorensK

Another debugging tip: check the traceback for which Python is trying to install setuptools_scm, because it may be different than the Python in your path. In my case it was homebrew, pip, and Anaconda colliding. Uninstalling & reinstalling things and then restarting iTerm fixed it for me.

sursh avatar Feb 21 '19 00:02 sursh

My traceback had pip using easy_install but installing with pip shows that the package is already satisfied D: It's happening during a spacy installation with Requirement.parse('wheel<0.33.0,>=0.32.0') of all things

daxaxelrod avatar Feb 22 '19 17:02 daxaxelrod

To fix your problem I think that you can tap the command pip install pbr I had the same problem

Ladinstar avatar May 18 '19 09:05 Ladinstar

@ladinstar i am having the same issue while installing rpy2 library.

I installed pbr but still no luck.

adityasood11 avatar Aug 13 '19 06:08 adityasood11

or you could use a virtual environment to get around library conflicts

denisechambers avatar Sep 29 '20 18:09 denisechambers

@Ladinstar i am having the same issue while installing rpy2 library.

I installed pbr but still no luck.

Same, not working for installing matplotlib

kailichou avatar Jan 04 '21 03:01 kailichou

Thanks, man, you saved my day :)

youkaichao avatar Dec 30 '21 06:12 youkaichao