Install & Compatibility
Where this runs
tested against v3.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.778s · 29.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.7s · import 0.682s · 30MB
28MB installed
● package 28MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Canvas
✓ from canvasapi import Canvas
✗ from canvasapi.canvas import Canvas
Canvas is a top-level export
Course
✓ from canvasapi import Course
✗ cannot import from canvasapi.course directly before Canvas object
Course uses are returned from Canvas methods; direct import not common
Initialize a Canvas object with your instance URL and API key, then fetch current user and courses.
from canvasapi import Canvas
# Replace with your Canvas instance URL and API key
api_url = 'https://canvas.instructure.com'
api_key = os.environ.get('CANVAS_API_KEY', '')
canvas = Canvas(api_url, api_key)
user = canvas.get_current_user()
print(f"Hello, {user.name}!")
# List courses
courses = canvas.get_courses()
for course in courses:
print(course.name)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'canvasapi'
canvasapi not installed
canvasapi.exceptions.Unauthorized: 401 Unauthorized
Invalid or missing API key
fixEnsure you pass a valid API key to the Canvas constructor.
AttributeError: 'PaginatedList' object has no attribute '...'
Trying to access a method directly on PaginatedList instead of iterating
fixIterate over the PaginatedList or convert to list first: 'list(canvas.get_courses())'
TypeError: 'Canvas' object is not callable
Forgetting to import and using wrong reference
fixUse 'canvas = Canvas(url, key)' after 'from canvasapi import Canvas'
Upgrade
Version history
3.6.0latest on PyPI · released Apr 16, 2026
Audit
Dependencies
requestsrequiredHTTP client used for API calls
pytzrequiredTimezone handling for datetime objects