question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'module' object has no attribute 'Provider' on Faker()

See original GitHub issue

When i create a Faker class i got following error:

ERROR: Failure: AttributeError ('module' object has no attribute 'Provider')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/rentapplication/django-rentapplication/rentapplication/tests/test_api/test_sessions.py", line 10, in <module>
    from rentapplication.tests.helpers import ReferrerFactory, LandlordFactory
  File "/home/rentapplication/django-rentapplication/rentapplication/tests/helpers.py", line 35, in <module>
    f = Faker()
  File "/usr/local/lib/python2.7/dist-packages/faker/factory.py", line 38, in create
    prov_cls, lang_found = cls._get_provider_class(prov_name, locale)
  File "/usr/local/lib/python2.7/dist-packages/faker/factory.py", line 49, in _get_provider_class
    provider_class = cls._find_provider_class(provider, locale)
  File "/usr/local/lib/python2.7/dist-packages/faker/factory.py", line 87, in _find_provider_class
    return provider_module.Provider
AttributeError: 'module' object has no attribute 'Provider'```

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:22

github_iconTop GitHub Comments

4reactions
Oxicodecommented, Sep 25, 2018

+1

1reaction
fcurellacommented, Feb 6, 2019

@aramanath The latest commit on python-testdata is from 2014. That makes me think it was written against an ancient version of Faker, probably v0.4.2 or earlier. You should file an issue on python-testdata.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Got "AttributeError: module 'faker.providers.en_US' has no ...
After install "pip install Faker", I did below: from faker import Faker fake = Faker(). Once I run above command, it's throw exception, ......
Read more >
Using the Faker Class — Faker 15.3.4 documentation
If no generator supports the provider method, an AttributeError will be raised just as it would have been raised using old Faker ....
Read more >
Faker - PyPI
Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in...
Read more >
1958987 – python-pytest-randomly fails to build with Python ...
Bug 1958987 - python-pytest-randomly fails to build with Python 3.10: AttributeError: 'PosixPath' object has no attribute 'startswith'.
Read more >
Generating Fake Data for Python Unit Tests with Faker
Learn how to use Faker built-in providers to generate fake data sets in your Python unit tests and even how to write your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found