Troubleshooting¶
Missing Dependency Errors¶
MySQL Support Not Installed¶
======================================================================
MySQL Support Not Installed
======================================================================
MySQL was detected in your Django settings:
→ DATABASES['default']['ENGINE']
To enable MySQL support, install the required dependencies:
pip install django-testcontainers-plus[mysql]
======================================================================
Cause: MySQL was detected in your DATABASES settings, but mysql-connector-python is not installed.
Fix:
Redis Support Not Installed¶
Same pattern as MySQL - install the redis extra:
Common Questions¶
Q: Why do I need extras for MySQL/Redis but not PostgreSQL?
PostgreSQL works without extras because the base testcontainers package includes
PostgreSQL support. MySQL and Redis require their respective Python client libraries.
Q: Can I disable auto-detection for a service I'm not using?
Yes - set auto: False in your TESTCONTAINERS config:
Q: A service was detected but I don't actually use it in tests
Check your settings for indirect references to Redis or MySQL in:
DATABASES- database enginesCACHES- cache backendsCELERY_BROKER_URL- Celery brokerSESSION_ENGINE- session storage
Disable detection for that service with auto: False.
Q: Tests work locally but fail in CI
Ensure your CI environment has:
- Docker available - most CI providers (GitHub Actions, GitLab CI) include it
- All required extras installed -
pip install django-testcontainers-plus[all] - Sufficient Docker permissions - some environments require
sudoor a docker group
Q: Container startup is slow
Docker needs to pull images on first run. After that, images are cached locally. In CI, use Docker layer caching to speed this up.
Q: Port conflicts
Containers use randomly assigned ports, so conflicts are rare. If you're seeing connection issues, ensure no other services are binding to the same port range.
Getting Help¶
If you can't find your answer here, please open an issue on GitHub with:
- Your
DATABASES/CACHESsettings (redact sensitive values) - The full error traceback
- Your Python, Django, and package versions