requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

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

Open akenney opened this issue 3 years ago • 0 comments

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.

akenney avatar Apr 13 '22 18:04 akenney