关键需要使用text
from sqlalchemy import create_engine, text sql = 'SELECT * FROM my_table WHERE account_id = :account_id and amount =: amount' session.execute( text(sql), {"account_id": 100000, "amount": 500} )