Solvedfactory_boy ImportError: The fake-factory package is now called Faker.

Trying to import factory, but it looks like since yesterday, one of the required packages has changed it's name:

    import factory
  File "/venv/lib64/python3.5/site-packages/factory/", line 46, in <module>
    from .faker import Faker
  File "/venv/lib64/python3.5/site-packages/factory/", line 41, in <module>
    import faker
  File "/venv/lib64/python3.5/site-packages/faker/", line 7, in <module>
    raise ImportError(error)
ImportError: The ``fake-factory`` package is now called ``Faker``.

Edit: I now see there's already a commit to fix this. Any chance of a release to pypi?

15 Answers

✔️Accepted Answer

Just fixed with 2.8.1 — I had to upload a couple of versions to fix an issue with recent setuptools versions.

Sorry for the release lag :/

Other Answers:

@jdufresne seems so, yes...

It broke our tests in Travis:

However, the same tests run just fine here in my pre-existing venv.

That's because in my existing venv I have fake-factory==0.7.2 which satisfies the requirement on fake-factory>=0.5.0 from factory_boy (2.7.0).

But then when creating a new venv and installing factory_boy, then pip will download the latest version of fake-factory==9999.9.9, which only contains:

VERSION = '9999.9.9'

error = """The ``fake-factory`` package is now called ``Faker``.

Please update your requirements.
raise ImportError(error


Can we have a new release of factory_boy using Faker, please? 😃

I ran into this as well -- the solution that worked for me was to reference fake-factory in my requirements.txt file (before factory-boy):


Oops. We already swapped over to the new name back in this commit: dba31e3

However, looks like we forgot to cut a new release. @rbarrois is likely asleep right now, but hopefully he can get to it when he wakes up as I don't have Pypi rights for this project.

More Issues: