HF_HUB_VERSION = version.parse(importlib.metadata.version("huggingface_hub"))
setuptools version
huggingface_hub
Python version
py3.8
OS
linux
Additional environment information
No response
Description
HF_HUB_VERSION = version.parse(importlib.metadata.version("huggingface_hub"))
How to Reproduce
Successfully installed huggingface_hub-0.25.0
aistudio@jupyter-16705695-8894579:~/PaddleMIX/ppdiffusers/examples/stable_diffusion$ sh train.sh
/home/aistudio/.local/lib/python3.8/site-packages/_distutils_hack/init.py:31: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
warnings.warn(
Traceback (most recent call last):
File "train_txt2img_laion400m_trainer.py", line 19, in
Other detail
From the description, it is not clear how the specific failure in HF_HUB_VERSION = version.parse(importlib.metadata.version("huggingface_hub")) is related to setuptools.
To proceed investigation we need a more complete reproducer. Please have a look on https://stackoverflow.com/help/minimal-reproducible-example.
If possible, please use a docker container to create the reproducer. This is very useful because ensures the error is reproducible in an isolated environment.
Also note that setuptools no longer supports Python 3.8, so please consider a new Python version when creating the reproducer.
Regarding the warning about setuptools. This means that somewhere, something is importing distutils.
If you wish to register a concern, please describe in detail the use case and why you cannot replace distutils with a different package.
Please have a look on https://peps.python.org/pep-0632/#migration-advice and https://setuptools.pypa.io/en/latest/deprecated/index.html for suggestions.
The error doesn't seem related to setuptools at all. It's bewteen a direct usage of packaging, importlib.metadata, and huggingface_hub.
As for the warning, there's an arbitrary train.sh script being run here that I can't find in https://github.com/PaddlePaddle/PaddleMIX/tree/develop/ppdiffusers/examples/stable_diffusion either. Without seeing the script content the best we can say is distutils usage should be fixed there. (ie: don't use or patch distutils directly)