5

I am using alembic in a project. Everything works as expected, but when checking the types with mypy I am getting:

error: Module "alembic" has no attribute "op"  [attr-defined]
error: Module "alembic" has no attribute "context"  [attr-defined]

Any idea how to resolve this? Do I need to install types? Is there something else that I am missing?

1
  • 4
    There are stubs for op and context only. You need only alembic installed into the same environment where mypy lives (e.g. add it into additional_dependencies of .pre-commit-config). Relevant issue Commented Jan 23, 2023 at 20:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.