Skip to content
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

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

Closed
RjLi13 opened this issue Aug 8, 2017 · 14 comments
Assignees

Comments

@RjLi13
Copy link

RjLi13 commented Aug 8, 2017

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/ 
@lukesneeringer
Copy link
Contributor

lukesneeringer commented Aug 8, 2017

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
Copy link
Contributor

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. :-/

@theacodes
Copy link
Contributor

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/

@RjLi13
Copy link
Author

RjLi13 commented Aug 8, 2017

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!

@theacodes
Copy link
Contributor

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

@RjLi13
Copy link
Author

RjLi13 commented Aug 8, 2017

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!

@LorensK
Copy link

LorensK commented Sep 18, 2018

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.

@sursh
Copy link

sursh commented Feb 21, 2019

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.

@daxaxelrod
Copy link

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

@Ladinstar
Copy link

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

@adityasood11
Copy link

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

I installed pbr but still no luck.

@denisechambers
Copy link

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

@kailichou
Copy link

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

I installed pbr but still no luck.

Same, not working for installing matplotlib

openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this issue Apr 12, 2021
Python 2 jobs recently started failing frequently with the following
error:

    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr>=2.0.0')

The root cause appears to be that indirect requirements are handled by
easy_install which doesn't like some index servers [1]. Try updating
setuptools first.

[1] googleapis/google-cloud-python#3757 (comment)

Change-Id: I95303e52f2b462ceda21abaa4097cc9291362d33
openstack-mirroring pushed a commit to openstack/kayobe that referenced this issue Apr 13, 2021
Python 2 jobs recently started failing frequently with the following
error:

    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr>=2.0')

The root cause appears to be that indirect requirements are handled by
easy_install which doesn't like some index servers [1]. Install the
latest setuptools first to work around the issue.

Disable upgrade jobs since the same issue is affecting Kayobe
installation in the previous release (Rocky).

[1] googleapis/google-cloud-python#3757 (comment)

Change-Id: I1b86c5f58d0c3b63269766eaa8e76af18b5fadb1
openstack-mirroring pushed a commit to openstack/kayobe that referenced this issue Apr 13, 2021
Python 2 jobs recently started failing frequently with the following
error:

    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr>=2.0')

The root cause appears to be that indirect requirements are handled by
easy_install which doesn't like some index servers [1]. Install the
latest setuptools first to work around the issue.

Disable IPA builds on CentOS 7 which are failing due to the same issue
and would require a fix inside DIB itself.

[1] googleapis/google-cloud-python#3757 (comment)

Change-Id: I1b86c5f58d0c3b63269766eaa8e76af18b5fadb1
Depends-On: https://review.opendev.org/c/openstack/kayobe/+/785869
@youkaichao
Copy link

Thanks, man, you saved my day :)

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

No branches or pull requests