xadmin Error:
File “/home/lijun/app/hippo/hippo_api/venv/lib/python3.8/site-packages/xadmin/plugins/importexport.py”, line 48, in <module>
from import_export.admin import DEFAULT_FORMATS, SKIP_ADMIN_LOG, TMP_STORAGE_CLASS
ImportError: cannot import name ‘DEFAULT_FORMATS’ from ‘import_export.admin’ (/home/lijun/app/hippo/hippo_api/venv/lib/python3.8/site-packages/import_export/admin.py)
Django Version: 2.2
Xadmin Version: 2.0.1
python Version: 3.8.10
File “/home/lijun/app/hippo/hippo_api/venv/lib/python3.8/site-packages/xadmin/plugins/importexport.py”, line 48, in <module>
from import_export.admin import DEFAULT_FORMATS, SKIP_ADMIN_LOG, TMP_STORAGE_CLASS
ImportError: cannot import name ‘DEFAULT_FORMATS’ from ‘import_export.admin’ (/home/lijun/app/hippo/hippo_api/venv/lib/python3.8/site-packages/import_export/admin.py)
Django Version: 2.2
Xadmin Version: 2.0.1
python Version: 3.8.10
Solution:
Click to go to the error report directory at: importexport.py
Note the error message line:
Click to go to the error report directory at: importexport.py
Note the error message line:
# from import_export.admin import DEFAULT_FORMATS, SKIP_ADMIN_LOG, TMP_STORAGE_CLASS
And add the following code:
from import_export.formats.base_formats import DEFAULT_FORMATS from import_export.admin import ImportMixin, ImportExportMixinBase
As shown below:
Similar Posts:
- import win32api; Importerror: DLL load failed: the specified program was not found
- [Solved] peewee error: ImportError: No module named ‘MySQLdb’;pymysql error: from . import connections # noqa: E402
- [Solved] SQLAlchemy Error: ImportError: cannot import name ‘TYPE_CHECKING’
- [Solved] “import numpy as np” ImportError: No module named numpy
- [Solved] Importerror: DLL load failed while importing mtrand: the specified program could not be found.
- [Solved] Captcha Library Error: “OSError: cannot open resource”
- Django startup error: generator expression must be parentized
- [Solved] ImportError: cannot import name pywrap_tensorflow
- [Solved] ModuleNotFoundError: No module named’usysconfigdata u x86 64-u-gnu’
- [Solved] rosrun import rospy Error: ImportError: No module named yaml