I am currently trying to get Sentry to work with my Django project. While initializing Sentry in the settings.py file I get this error:
line 301, in module import sentry_sdk ModuleNotFoundError: No module named 'sentry_sdk' unable to load app 0 (mountpoint='') (callable not found or import error)
I copied the docs, and I'm wondering why this is happening. Has anyone experienced this issue before? My Django version is 2.2.11 and I'm running python v 3.9.5
Here is the code for the docs if it matters (pip install --upgrade sentry-sdk)
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
integrations=[DjangoIntegration()],
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production,
traces_sample_rate=1.0,
# If you wish to associate users to errors (assuming you are using
# django.contrib.auth) you may enable sending PII data.
send_default_pii=True,
# By default the SDK will try to use the SENTRY_RELEASE
# environment variable, or infer a git commit
# SHA as release, however you may want to set
# something more human-readable.
# release="myapp@1.0.0",
)