joke2k / django-faker

Django-faker uses fake-factory to generate test data for Django models and templates
MIT License
245 stars 48 forks source link

ImportError: cannot import name Faker #10

Open BrendanBerkley opened 10 years ago

BrendanBerkley commented 10 years ago

I did a fresh install and was actually able to generate some Users, but then after trying to run a python script outside of the console, something went wrong and it doesn't work again. This error message isn't very helpful to me :frowning:

Any ideas? I tried uninstalling and reinstalling and doing exactly what I did to make it work before, but still got the following.

Python 2.7.5+ (default, Feb 27 2014, 19:37:08) 
[GCC 4.8.1] on linux2
>>> from django_faker import Faker
>>> populator = Faker.getPopulator()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/django_faker/__init__.py", line 90, in getPopulator
    generator = cls.generators.get(codename,  None) or cls.getGenerator(codename=codename)
  File "/usr/local/lib/python2.7/dist-packages/django_faker/__init__.py", line 54, in getGenerator
    from faker import Faker as FakerGenerator
ImportError: cannot import name Faker
officialrahulmandal commented 4 years ago

Hey @BrendanBerkley , Why don't you use Faker library which is there on pypi.org. it's really cool and have a good documentation. Happy coding :-)