Search code examples
pythondjangodatabasedumpmodulenotfounderror

Django dump data got module not found error from Allauth and other package


After run

python manage.py dumpdata > data.json

I get this ModuleNotFoundError: No module named 'allauth' and if i comment the allauth in the installed apps i still get another error on another package that might have a data


Solution

  • You need to install it in your environment using pip. You should also add it to your requirements.txt file.

    If you get more of the same errors, continue to install the missing packages.

    As per our comments, it turns out that whilst yes, the package was not installed, the ultimate issue was quite specific to your use case, which was that you had not activated the correct environment for the project.

    please note this should not confuse the cause of the error, and that being the package was not installed

    For bonus points, one can use docker instead of virtual environments, and one massive benefit of this is docker is compatible with pretty much any development operating system host.

    I wont dig too deep into that subject, but rather allow you to investigate and post new questions relating to your new use case if you decide to go that way