AttributeError: 'module' object has no attribute 'packages'

Viewed 3314

when running test i'm getting this error.
earlier i'm using python-requests v2.2.1.so, i have upgraded python-requests to v2.14.2 but still i'm facing the same issue.
HeaderDict(requests.packages.urllib3._collections.HTTPHeaderDict): AttributeError: 'module' object has no attribute 'packages'
check the below result:

======================================================================
ERROR: rest_blog.tests.test_views (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.4/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib/python3.4/unittest/case.py", line 577, in run
    testMethod()
  File "/usr/lib/python3.4/unittest/loader.py", line 32, in testFailure
    raise exception
ImportError: Failed to import test module: rest_blog.tests.test_views
Traceback (most recent call last):
  File "/usr/lib/python3.4/unittest/loader.py", line 312, in _find_tests
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.4/unittest/loader.py", line 290, in _get_module_from_name
    __import__(name)
  File "/home/vamsi/PycharmProjects/ReminderToDo/rest_blog/tests/test_views.py", line 6, in <module>
    from rest_framework.test import force_authenticate
  File "/usr/local/lib/python3.4/dist-packages/rest_framework/test.py", line 30, in <module>
    class HeaderDict(requests.packages.urllib3._collections.HTTPHeaderDict):
AttributeError: 'module' object has no attribute 'packages'


----------------------------------------------------------------------

1 Answers
Related