13👍
Install the import_export module by writing this command in command prompt
pip install --user django-import_export
or use
pip install django-import_export
3👍
I guess you used virtual environment to develop some parts of your project (maybe accidentally) and then you switched it off.
Try to reinstall the modules with your virtual environment activated.
- ValueError: Incorrect timezone setting while migrating manage.py file in Django
- Datetime.strptime () throws 'does not match format' error
- Django CommandError: App 'polls' has migrations
- Sudo pip install django
2👍
I had the same bug before, and here is what I did.
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.conf',
'import_export',]
Be careful, the order of 'django.conf'
and 'import_export'
cannot be changed.
- Django, register user with first name and last name?
- Getting scrapy project settings when script is outside of root directory
- Django signals, how to use "instance"
- TypeError: create_superuser() missing 1 required positional argument: 'profile_picture'
- Google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead : Google Place autocomplete Error
1👍
I guess you have installed Django in virtualenv
. Now when you installed django-import-export
you forgot to activate your virtual environment. I doubt there is something else.
Also make sure that your virtual environment is enabled when you run django manage.py collectstatic
. You might have installed Django outside all virtual environments once in the past (by mistake) and is therefore not raising “Django not found” errors but cannot find import_export
because you actually installed it in virtual environment.
- Django inline foreign key does not match parent primary key
- Django Rest Ordering custom
- Is there a way to generate pdf containing non-ascii symbols with pisa from django template?
- Why is post_save being raised twice during the save of a Django model?
0👍
Following worked for me, I still don’t understand why.
-
Delete your virtual env directory.
rm -rf env
-
Come out of the virtual env.
exec $SHELL
-
Create the virtual environment again.
python -m venv env
-
Activate your virtual env.
source ./env/bin/activate
-
Install the requirements again.
pip install -r requirements.txt
And it worked
- Python + Django + VirtualEnv + Windows
- Overriding Django REST ViewSet with custom post method and model
- SerializerClass field on Serializer save from primary key
- Django REST Framework (ModelViewSet), 405 METHOD NOT ALLOWED
- Pillow installation error: command 'gcc' failed with exit status 1
0👍
to solve this problem you can try by installing django import-export
only, I tried installing import-export
which by default is 0.3.1 version
and django import-export
installs 3.2.0 version
and fixed the problem
- How to compare version string ("x.y.z") in MySQL?
- Override default Django translations
- Active Django settings file from Celery worker
- Error loading MySQLdb module: libmysqlclient.so.20: cannot open shared object file: No such file or directory
- Django REST – Create object with foreign key using serializers