Skip to content

ModuleNotFoundError: No module named '_cffi_backend' #975

@SmartManoj

Description

@SmartManoj
Traceback (most recent call last):
  File "/kaggle/working/a.py", line 1, in <module>
    from openhands.sdk import LLM, Conversation, Agent
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/__init__.py", line 3, in <module>
    from openhands.sdk.agent import Agent, AgentBase
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/agent/__init__.py", line 1, in <module>
    from openhands.sdk.agent.agent import Agent
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/agent/agent.py", line 6, in <module>
    from openhands.sdk.agent.base import AgentBase
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/agent/base.py", line 10, in <module>
    import openhands.sdk.security.analyzer as analyzer
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/security/analyzer.py", line 3, in <module>
    from openhands.sdk.event.base import Event
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/event/__init__.py", line 1, in <module>
    from openhands.sdk.event.base import Event, LLMConvertibleEvent
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/event/base.py", line 10, in <module>
    from openhands.sdk.llm import ImageContent, Message, TextContent
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/llm/__init__.py", line 1, in <module>
    from openhands.sdk.llm.llm import LLM
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/llm/llm.py", line 25, in <module>
    from openhands.sdk.utils.pydantic_secrets import serialize_secret, validate_secret
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/utils/pydantic_secrets.py", line 3, in <module>
    from openhands.sdk.utils.cipher import Cipher
  File "/usr/local/lib/python3.12/dist-packages/openhands/sdk/utils/cipher.py", line 12, in <module>
    from cryptography.fernet import Fernet
  File "/usr/lib/python3/dist-packages/cryptography/fernet.py", line 16, in <module>
    from cryptography.hazmat.primitives import hashes, padding
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/padding.py", line 11, in <module>
    from cryptography.hazmat.bindings._padding import lib
ModuleNotFoundError: No module named '_cffi_backend'

Solution: update cryptography

Old one: cryptography-3.4.8
New one: cryptography-46.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions