factory_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/__init__.py", line 46, in <module>
from .faker import Faker
File "/venv/lib64/python3.5/site-packages/factory/faker.py", line 41, in <module>
import faker
File "/venv/lib64/python3.5/site-packages/faker/__init__.py", 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?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 46
- Comments: 16 (4 by maintainers)
Commits related to this issue
- Pin fake-factory fake-factory has been deprecated and replaced with the Faker library. factory_boy has been updated to account for this, but the fix hasn't yet been released: https://github.com/Fa... — committed to hypothesis/h by nickstenning 8 years ago
- Fix unit tests When we can update to a new version of factory_boy we can remove the ‘fake-factory’ requirement (see: https://github.com/FactoryBoy/factory_boy/issues/334) — committed to ubc/compair by andrew-gardener 8 years ago
- Upgrade our deps Upgrading factory-boy fixes the build: https://github.com/FactoryBoy/factory_boy/issues/334 But while we're at it, we might as well upgrade everything. — committed to ideascube/ideascube by deleted user 8 years ago
- Upgrade our deps Upgrading factory-boy fixes the build: https://github.com/FactoryBoy/factory_boy/issues/334 But while we're at it, we might as well upgrade everything. — committed to ideascube/ideascube by deleted user 8 years ago
- Fix FactoryBoy dependency problem Workaround until upgrading to FactoryBoy 2.8.1 https://github.com/FactoryBoy/factory_boy/issues/334 — committed to aaxelb/SHARE by aaxelb 8 years ago
- Work around FactoryBoy dependency issue Should update to FactoryBoy 2.8.1 when it doesn't break our tests https://github.com/FactoryBoy/factory_boy/issues/334 — committed to aaxelb/SHARE by aaxelb 8 years ago
- Upgrade test library to address import error Referenced in the issue here: https://github.com/FactoryBoy/factory_boy/issues/334 Version 2.8.1 of the factory-boy library contains an update to referen... — committed to jazzband/django-silk by avelis 8 years ago
- Upgrades testing library requirement Referenced in the issue here: https://github.com/FactoryBoy/factory_boy/issues/334 Version 2.8.1 of the factory-boy library references the new Faker library name... — committed to jazzband/django-silk by avelis 8 years ago
- Fix requirement (https://github.com/FactoryBoy/factory_boy/issues/334) — committed to VOKO-Utrecht/voko by rikva 8 years ago
- Upgrade our deps Upgrading factory-boy fixes the build: https://github.com/FactoryBoy/factory_boy/issues/334 But while we're at it, we might as well upgrade everything. — committed to ideascube/ideascube by deleted user 8 years ago
- Upgrade our deps Upgrading factory-boy fixes the build: https://github.com/FactoryBoy/factory_boy/issues/334 But while we're at it, we might as well upgrade everything. — committed to ideascube/ideascube by deleted user 8 years ago
- fix: build, dependencies, requirements: updated the 'factory-boy' version requirement to 2.8.1, to work around the backward-compatibility-breaking deprecation of the 'fake-factory' module. Details: S... — committed to Justin-W/drfunland by Justin-W 7 years ago
- fix: build, dependencies, requirements: updated the 'factory-boy' version requirement to 2.8.1, to work around the backward-compatibility-breaking deprecation of the 'fake-factory' module. Details: S... — committed to Justin-W/drfunland by Justin-W 7 years ago
- Upgrade factory boy Currently, running `py.test mysite` raises this error: E ImportError: The ``fake-factory`` package is now called ``Faker``. E E Please update your requirement... — committed to makinacorpus/robotframework-djangolibrary by deleted user 7 years ago
- Upgrade factory boy Currently, running `py.test mysite` raises this error: E ImportError: The ``fake-factory`` package is now called ``Faker``. E E Please update your requirement... — committed to makinacorpus/robotframework-djangolibrary by deleted user 7 years ago
- Upgrade factory-boy This ought to fix the tests. See https://github.com/FactoryBoy/factory_boy/issues/334 — committed to meshy/incuna-test-utils by meshy 7 years ago
- Upgrade test library to address import error Referenced in the issue here: https://github.com/FactoryBoy/factory_boy/issues/334 Version 2.8.1 of the factory-boy library contains an update to referen... — committed to yaroslav0114/django-silk by ProFullStackDev 8 years ago
- Upgrades testing library requirement Referenced in the issue here: https://github.com/FactoryBoy/factory_boy/issues/334 Version 2.8.1 of the factory-boy library references the new Faker library name... — committed to yaroslav0114/django-silk by ProFullStackDev 8 years ago
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 😕
@jdufresne seems so, yes…
It broke our tests in Travis: https://travis-ci.org/ideascube/ideascube/builds/184587115
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 onfake-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:Nice.
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 myrequirements.txt
file (beforefactory-boy
):Oops. We already swapped over to the new name back in this commit: https://github.com/FactoryBoy/factory_boy/commit/dba31e3866cdefde1d7f37fc7f0553a12feeab9b
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.
We are already aware of this. Please use the thumbs up button rather than spamming everyone with a “me too”. Thanks.
PS: For now, a simple workaround is to temporarily install off of
master
branch where this is already fixed as described in https://github.com/FactoryBoy/factory_boy/issues/334#issuecomment-267672355Looks like everyone is having a same problem here 😉
Faker library released the latest version 0.7.5 which deprecates fake-factory package name.
If factory-boy uses Faker 0.7.4, the issue could be resolved.
First uninstall fake-factory using
Then check if it is uninstalled using
Then, proceed with installing Faker by,