If anyone still have this issues.
check for this import in settings.py
from rest_framework.schemas import openapi
Remove it because it references
rest_framework.schemas.openapi
which conflicts with drf-spectacular. spectacular provides its own schema generator.