requests / requests-oauthlib

OAuthlib support for Python-Requests!
https://requests-oauthlib.readthedocs.org/
ISC License
1.71k stars 421 forks source link

'requests' distribution not found when listed in install_requires together with requests_oauthlib #490

Open akenney opened 2 years ago

akenney commented 2 years ago

This error may somehow be specific to my environment but I'm not sure how. I posted on Stackoverflow and didn't get any responses.

I have a setup.py file for a python package and when I try to run python setup.py develop it gets stuck on installing the requests package, apparently because of requests_oauthlib also being a requirement. The following minimal example setup.py file still results in the same error:

from setuptools import setup

setup(
    name='fakepackage',
    install_requires=[
        'requests_oauthlib',
        'requests',
    ]
)

The error is "error: The 'requests' distribution was not found and is required by fakepackage". This happens regardless of the order in which I list the elements of the install_requires list.

If I run pip install requests manually, it installs fine, so I'm not sure what it's not finding. If I don't list requests at all in the setup.py file, and only list requests_oauthlib, it also installs fine (including installing requests, because it's a dependency of requests_oauthlib).

I'm using Python 3.8.10, setuptools version 44.0.0.