xblock-google-drive
raw JSON → 0.8.2 verified Fri May 01 auth: no python
An XBlock for embedding Google Documents (Docs, Sheets, Slides, Forms) and Google Calendar within an Open edX course. Current version 0.8.2, requires Python >=3.12, follows Open edX release cadence.
pip install xblock-google-drive Common errors
error ModuleNotFoundError: No module named 'xblock_google_drive' ↓
cause Package not installed or import path incorrect (underscore vs hyphen).
fix
Install: pip install xblock-google-drive. Then import with underscores: from xblock_google_drive import ...
error AttributeError: module 'xblock_google_drive' has no attribute 'GoogleDriveBlock' ↓
cause GoogleDriveBlock is not exported from package __init__.py.
fix
Use correct import: from xblock_google_drive.google_drive import GoogleDriveBlock
error django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. ↓
cause Trying to use block outside an edX environment without setting up Django settings.
fix
Configure Django settings before importing block: import django; django.conf.settings.configure(); django.setup()
Warnings
gotcha Requires Python >=3.12 as of v0.8.2. If your edX platform runs Python 3.8-3.11, pin to <=0.8.1 or use v0.8.0 which supports Python 3.8-3.11. ↓
fix Downgrade: pip install 'xblock-google-drive<=0.8.1'
breaking Removed locale files and Transifex integration in v0.7.0 (OEP-58). Translations now managed via Atlas; custom translation overrides may break. ↓
fix Use Atlas-compatible translation workflow; remove locale files from repo if previously used.
breaking Removed xblockutils dependency in v0.5.0. Code that relied on xblockutils compat wrappers (e.g., XBlockWithMixins) may need adaptation. ↓
fix Migrate to direct XBlock base class or include xblockutils explicitly if needed.
deprecated Python 3.8 support dropped in v0.8.0. Python 3.11 support dropped in v0.8.2. Ensure your Python versions are compatible. ↓
fix Upgrade Python environment to 3.12; or pin to older releases.
Imports
- GoogleDriveBlock wrong
from xblock_google_drive import GoogleDriveBlockcorrectfrom xblock_google_drive.google_drive import GoogleDriveBlock - GoogleCalendarBlock wrong
from xblock_google_drive.google_drive import GoogleCalendarBlockcorrectfrom xblock_google_drive.google_calendar import GoogleCalendarBlock
Quickstart
from xblock_google_drive.google_drive import GoogleDriveBlock
from xblock_google_drive.google_calendar import GoogleCalendarBlock
# Typically used within an edX modulestore; direct instantiation is rare.
# Example configuration:
block = GoogleDriveBlock()
block.document_id = '1abc...' # Google Doc ID from URL
block.display_name = 'My Doc'