Skip to content

class HeaderDict(rest_requests.packages.urllib3._collections.HTTPHeaderDict): AttributeError: module 'requests' has no attribute 'packages' #6954

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

Open
Luke1606 opened this issue May 25, 2025 · 2 comments

Comments

@Luke1606
Copy link

fix released in 2.17.2!

Originally posted by @kennethreitz in #4104

Im using requests 2.32.3 with djangorestframework 3.16.0 but im still having the same problem: This commit seems to have broken requests.packages.

from rest_framework.test import APITestCase
:1360: in _find_and_load
???
:1331: in _find_and_load_unlocked
???
:935: in _load_unlocked
???
...venv\Lib\site-packages_pytest\assertion\rewrite.py:185: in exec_module
exec(co, module.dict)
...venv\Lib\site-packages\rest_framework\test.py:27: in
class HeaderDict(rest_requests.packages.urllib3._collections.HTTPHeaderDict):
AttributeError: module 'requests' has no attribute 'packages'
ERROR users/tests.py - AttributeError: module 'requests' has no attribute 'packages'

Somebody please help me

@sigmavirus24
Copy link
Contributor

What else do you have installed? There are packages designed to break requests that might be installed

@Luke1606
Copy link
Author

What else do you have installed? There are packages designed to break requests that might be installed

this is all i have
'daphne',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'rest_framework',
'rest_framework_simplejwt',
'rest_framework_simplejwt.token_blacklist',
'channels',
'django_filters',

the rest are the apps i've created, the problem shouldnt be there

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

No branches or pull requests

2 participants