AttributeError: 'module' object has no attribute 'Provider' on Faker()
See original GitHub issueWhen 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:
- Created 8 years ago
- Comments:22
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
@aramanath The latest commit on
python-testdata
is from 2014. That makes me think it was written against an ancient version ofFaker
, probablyv0.4.2
or earlier. You should file an issue onpython-testdata
.