Install & Compatibility
Where this runs
tested against v2.6.3 · 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.394s · 44.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.5s · import 0.390s · 49MB
44MB installed
● package 44MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Application
✓ from blacksheep import Application
✗ from blacksheep.server import Application
In v2.x, Application is directly exposed from the top-level package. Using blacksheep.server was deprecated.
Request
✓ from blacksheep import Request
✗ from blacksheep.server import Request
Request and Response are top-level exports since v2.0.
Response
✓ from blacksheep import Response
get
✓ from blacksheep.server.routing import get
✗ from blacksheep import get
Route decorators are in routing module, not top-level.
Router
✓ from blacksheep.server.routing import Router
✗ from blacksheep.routing import Router
Router is under blacksheep.server.routing.
Inject
✓ from blacksheep.server.di import Inject
✗ from blacksheep import Inject
DI tools are in the blacksheep.server.di submodule.
Minimal BlackSheep app with a single route. Run with uvicorn or hypercorn.
from blacksheep import Application, Request, Response
from blacksheep.server.routing import get
app = Application()
@get('/')
async def home(request: Request) -> str:
return 'Hello, World!'
# Run using: uvicorn main:app
Errors
Common errors & fixes
ImportError: cannot import name 'Application' from 'blacksheep'
Installed version is older than v2.0 or import path changed.
fixUpgrade to latest: pip install --upgrade blacksheep. If still failing, use from blacksheep.server import Application for older versions.
TypeError: 'function' object is not subscriptable
Using synchronous handler or missing proper route decorator parentheses.
fixEnsure handler is async and use @get('/') with parentheses, not @get('/') without calling. RuntimeError: You must use `await` on the request body methods
Calling Request methods like .json() or .form() without await inside async handler.
fixUse await request.json() or await request.form().
Upgrade
Version history
2.6.3latest on PyPI · released Jun 4, 2026
Audit
Dependencies
httptoolsrequiredHTTP parsing
urllib3requiredHTTP client backend
blacksheep-jwtoptionalJWT authentication
pyjwtoptionalJWT encoding/decoding