python 3.12 not working on spaces
JackismyShephard opened this issue · 3 comments
Describe the bug
First of all, I am not sure this is the correct place to report issues with hugging spaces so apologies in advance.
I have noticed that python 3.12 does not seem to work on huggingface spaces. Upon initialization I get the error:
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
--> ERROR: process "/bin/sh -c pip install --no-cache-dir pip==22.3.1 && \tpip install --no-cache-dir \tdatasets \t\"huggingface-hub>=0.19\" \"hf-transfer>=0.1.4\" \"protobuf<4\" \"click<8.1\" \"pydantic~=1.0\"" did not complete successfully: exit code: 1
This is a well known error when using an old version of pip with python 3.12. It has been reported here, amongst other places.
I have tried upgrading pip manually using both pre-requirements.txt
and packages.txt
but that makes no difference. It seems that you are using the old version of pip to install pre-installed packages into spaces environments
Reproduction
No response
Logs
No response
System info
N/A
Hi @JackismyShephard , thanks for reporting. I've been able to reproduce this issue myself (https://huggingface.co/spaces/Wauplin/test-python-3.12). I've let the infra team know internally and will let you know once we know more.
@Wauplin Any update on this?
Hi@JackismyShephard sorry for the delayed response. Python 3.12 + Gradio 5.12.0 works fine on Spaces: https://huggingface.co/spaces/Wauplin/test-python-3.12. You can upgrade the gradio version in the readme metadata: https://huggingface.co/spaces/Wauplin/test-python-3.12/blob/main/README.md?code=true#L7.