Skip to content

Python 3.14 incompatibility #11

@anakin87

Description

@anakin87

Hello, and sorry for opening the issue here but did not find a better place.

ibm-watsonx-ai fails to import on Python 3.14 due to the removal of Enum.__init__ in CPython (python/cpython#128081).

Example

! pip install ibm-watsonx-ai
python -c "from ibm_watsonx_ai.foundation_models import ModelInference"

Error

Traceback (most recent call last):
File "<string>", line 1, in <module>
  from ibm_watsonx_ai.foundation_models import ModelInference
File "/redacted/python3.14/site-packages/ibm_watsonx_ai/foundation_models/__init__.py", line 6, in <module>
  from ibm_watsonx_ai.foundation_models.embeddings import Embeddings
File "/redacted/python3.14/site-packages/ibm_watsonx_ai/foundation_models/embeddings/__init__.py", line 7, in <module>
  from .embeddings import Embeddings
File "/redacted/python3.14/site-packages/ibm_watsonx_ai/foundation_models/embeddings/embeddings.py", line 26, in <module>
  from ibm_watsonx_ai.foundation_models.schema import BaseSchema, Crypto
File "/redacted/python3.14/site-packages/ibm_watsonx_ai/foundation_models/schema/__init__.py", line 6, in <module>
  from ibm_watsonx_ai.foundation_models.schema._api import *  # noqa: F403
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/redacted/python3.14/site-packages/ibm_watsonx_ai/foundation_models/schema/_api.py", line 114, in <module>
  class TextGenDecodingMethod(StrEnum):
      GREEDY = "greedy"
      SAMPLE = "sample"
File "/redacted/python3.14/enum.py", line 549, in __new__
  enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
File "/redacted/python3.14/enum.py", line 271, in __set_name__
  enum_member.__init__(*args)
  ~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/redacted/python3.14/site-packages/ibm_watsonx_ai/utils/utils.py", line 1182, in __init__
  super().__init__(*args, **kwargs)
  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: object.__init__() takes exactly one argument (the instance to initialize)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions