Skip to content

Unable to use docker image/compose(s) "No package metadata was found for ktransformers" #9683

@doug62

Description

@doug62

Reminder

  • I have read the above rules and searched the existing issues.

System Info

While running the docker image from dockerhub and/or docker\docker-cuda\docker-compose.yml and running:
llamafactory-cli train examples/train_lora/deepseek3_lora_sft_kt.yaml

I get:
root@6e0a81d68cb0:/# llamafactory-cli train examples/train_lora/deepseek3_lora_sft_kt.yaml
[2025-12-27 17:38:58,990] [INFO] [real_accelerator.py:254:get_accelerator] Setting ds_accelerator to cuda (auto detect)
/opt/conda/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
Traceback (most recent call last):
File "/opt/conda/lib/python3.11/importlib/metadata/init.py", line 563, in from_name
return next(cls.discover(name=name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/transformers/utils/versions.py", line 102, in require_version
got_ver = importlib.metadata.version(pkg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/importlib/metadata/init.py", line 1009, in version
return distribution(distribution_name).version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/importlib/metadata/init.py", line 982, in distribution
return Distribution.from_name(distribution_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/importlib/metadata/init.py", line 565, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for ktransformers

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/conda/bin/llamafactory-cli", line 7, in
sys.exit(main())
^^^^^^
File "/app/src/llamafactory/cli.py", line 24, in main
launcher.launch()
File "/app/src/llamafactory/launcher.py", line 157, in launch
run_exp()
File "/app/src/llamafactory/train/tuner.py", line 126, in run_exp
_training_function(config={"args": args, "callbacks": callbacks})
File "/app/src/llamafactory/train/tuner.py", line 55, in _training_function
model_args, data_args, training_args, finetuning_args, generating_args = get_train_args(args)
^^^^^^^^^^^^^^^^^^^^
File "/app/src/llamafactory/hparams/parser.py", line 364, in get_train_args
_check_extra_dependencies(model_args, finetuning_args, training_args)
File "/app/src/llamafactory/hparams/parser.py", line 160, in _check_extra_dependencies
check_version("ktransformers", mandatory=True)
File "/app/src/llamafactory/extras/misc.py", line 92, in check_version
require_version(requirement, hint)
File "/opt/conda/lib/python3.11/site-packages/transformers/utils/versions.py", line 104, in require_version
raise importlib.metadata.PackageNotFoundError(
importlib.metadata.PackageNotFoundError: No package metadata was found for The 'ktransformers' distribution was not found and is required by this application.
To fix: run pip install ktransformers.

To fix: run pip install ktransformers. - Fails as well

Reproduction

Put your message here.

Others

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis problem is yet to be addressed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions