Registry / devops / opentrons

opentrons

JSON →
library9.0.0pypypi✓ verified 83d ago

The Opentrons API is a simple Python framework for writing automated biology lab protocols on Opentrons robots (e.g., OT-2, Flex). Current version is 9.0.0, requiring Python >=3.10. The library is actively maintained with regular releases.

pip install opentrons
INSTALL
IMPORT
SIG · OPENTRONS
O
opentrons
devopspythonv9.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ProtocolContext
from opentrons.protocol_api import ProtocolContext
from opentrons import ProtocolContext
ProtocolContext moved to protocol_api submodule in v7+
simulate
from opentrons.simulate import simulate
from opentrons import simulate
simulate is a submodule, not top-level import since v4.

Minimal protocol that loads labware and performs a transfer.

from opentrons import protocol_api metadata = {'apiLevel': '2.13'} def run(protocol: protocol_api.ProtocolContext): plate = protocol.load_labware('corning_96_wellplate_360ul_flat', 1) tiprack = protocol.load_labware('opentrons_96_tiprack_300ul', 2) pipette = protocol.load_instrument('p300_single', mount='right', tip_racks=[tiprack]) pipette.pick_up_tip() pipette.aspirate(100, plate['A1']) pipette.dispense(100, plate['B1']) pipette.drop_tip()
Debug
Known issues
breakingAPI level versioning: protocols must specify an apiLevel in metadata. Using an outdated apiLevel may break with newer robot software.
fix
Set metadata['apiLevel'] to the latest or a compatible version (e.g., '2.13').
affects: >=2.0
breakingIn v7+, ProtocolContext and other classes moved to opentrons.protocol_api. Direct imports from opentrons may fail.
fix
Use 'from opentrons.protocol_api import ProtocolContext' instead.
affects: >=7.0
deprecatedThe 'opentrons.execute' module is deprecated; use 'opentrons.simulate' or run directly on robot.
fix
Replace 'opentrons.execute' with 'opentrons.simulate' for simulation.
affects: >=8.0
gotchaLabware names must match Opentrons definitions exactly; typos cause 'LabwareNotFoundError'.
fix
Use exact names from Opentrons Labware Library (e.g., 'corning_96_wellplate_360ul_flat').
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'opentrons'
Opentrons not installed or installed in wrong environment.
fix
Run 'pip install opentrons' and ensure you are using the correct Python environment.
KeyError: 'apiLevel'
Protocol metadata is missing the required 'apiLevel' key.
fix
Add 'metadata = {'apiLevel': '2.13'}' (or your version) before the run function.
opentrons.protocol_api.labware.LabwareNotFoundError
Labware name does not match any known definition.
fix
Check the exact labware name in the Opentrons Labware Library (https://labware.opentrons.com/).
Upgrade
Version history
9.0.0latest on PyPI · released Apr 7, 2026
Audit
Dependencies
pyserialoptionalSerial communication with robot
aiohttpoptionalAsync HTTP for robot communication
Agent activity
2 hits · last 30 days
node
2
Resources

No resource links recorded.

opentrons — pip install opentrons · libregistry