hello,
i’m a systems admin administering a machine running alma linux 9.6, in order to provide support for our users, who are python developers. i have a problem trying to run the huggingface cli. we’ve just installed a fresh new python, upgrading to 3.9 to 3.13.10. the error i get is :
$ huggingface-cli
Traceback (most recent call last):
File "/usr/local/bin/huggingface-cli", line 3, in <module>
from huggingface_hub.commands.huggingface_cli import main
ModuleNotFoundError: No module named 'huggingface_hub.commands'
looking at the directory structure, i can see that there is, indeed, no commands subdirectory.
here is some more information :
$ set | grep ^PY
PYTHONPATH=/usr/local/lib/python3.13:/usr/local/lib/python3.13/site-packages
PYTHONUSERBASE=/usr/local/lib/python3.13
$ python3 -V
Python 3.13.10
$ pip3 -V
pip 25.3 from /usr/local/lib/python3.13/site-packages/pip (python 3.13)
huggingface was not included in 3.13, so i installed it. the install didn’t solve the problem, so after checking a few things, i did a reinstall. in case it’s helpful, here is the output of my install :
$ pip3 install --cache-dir=/data/tmp --upgrade --force-reinstall huggingface_hub
Collecting huggingface_hub
Downloading huggingface_hub-1.3.5-py3-none-any.whl.metadata (13 kB)
Collecting filelock (from huggingface_hub)
Using cached filelock-3.20.3-py3-none-any.whl.metadata (2.1 kB)
Collecting fsspec>=2023.5.0 (from huggingface_hub)
Using cached fsspec-2026.1.0-py3-none-any.whl.metadata (10 kB)
Collecting hf-xet<2.0.0,>=1.2.0 (from huggingface_hub)
Using cached hf_xet-1.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)
Collecting httpx<1,>=0.23.0 (from huggingface_hub)
Using cached httpx-0.28.1-py3-none-any.whl.metadata (7.1 kB)
Collecting packaging>=20.9 (from huggingface_hub)
Downloading packaging-26.0-py3-none-any.whl.metadata (3.3 kB)
Collecting pyyaml>=5.1 (from huggingface_hub)
Downloading pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (2.4 kB)
Collecting shellingham (from huggingface_hub)
Using cached shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting tqdm>=4.42.1 (from huggingface_hub)
Using cached tqdm-4.67.1-py3-none-any.whl.metadata (57 kB)
Collecting typer-slim (from huggingface_hub)
Using cached typer_slim-0.21.1-py3-none-any.whl.metadata (16 kB)
Collecting typing-extensions>=4.1.0 (from huggingface_hub)
Using cached typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB)
Collecting anyio (from httpx<1,>=0.23.0->huggingface_hub)
Using cached anyio-4.12.1-py3-none-any.whl.metadata (4.3 kB)
Collecting certifi (from httpx<1,>=0.23.0->huggingface_hub)
Using cached certifi-2026.1.4-py3-none-any.whl.metadata (2.5 kB)
Collecting httpcore==1.* (from httpx<1,>=0.23.0->huggingface_hub)
Using cached httpcore-1.0.9-py3-none-any.whl.metadata (21 kB)
Collecting idna (from httpx<1,>=0.23.0->huggingface_hub)
Using cached idna-3.11-py3-none-any.whl.metadata (8.4 kB)
Collecting h11>=0.16 (from httpcore==1.*->httpx<1,>=0.23.0->huggingface_hub)
Using cached h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
Collecting click>=8.0.0 (from typer-slim->huggingface_hub)
Using cached click-8.3.1-py3-none-any.whl.metadata (2.6 kB)
Downloading huggingface_hub-1.3.5-py3-none-any.whl (536 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.7/536.7 kB 26.7 MB/s 0:00:00
Using cached hf_xet-1.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB)
Using cached httpx-0.28.1-py3-none-any.whl (73 kB)
Using cached httpcore-1.0.9-py3-none-any.whl (78 kB)
Using cached fsspec-2026.1.0-py3-none-any.whl (201 kB)
Using cached h11-0.16.0-py3-none-any.whl (37 kB)
Downloading packaging-26.0-py3-none-any.whl (74 kB)
Downloading pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (801 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 801.6/801.6 kB 30.4 MB/s 0:00:00
Using cached tqdm-4.67.1-py3-none-any.whl (78 kB)
Using cached typing_extensions-4.15.0-py3-none-any.whl (44 kB)
Using cached anyio-4.12.1-py3-none-any.whl (113 kB)
Using cached idna-3.11-py3-none-any.whl (71 kB)
Using cached certifi-2026.1.4-py3-none-any.whl (152 kB)
Using cached filelock-3.20.3-py3-none-any.whl (16 kB)
Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
Using cached typer_slim-0.21.1-py3-none-any.whl (47 kB)
Using cached click-8.3.1-py3-none-any.whl (108 kB)
Installing collected packages: typing-extensions, tqdm, shellingham, pyyaml, packaging, idna, hf-xet, h11, fsspec, filelock, click, certifi, typer-slim, httpcore, anyio, httpx, huggingface_hub
Attempting uninstall: typing-extensions
Found existing installation: typing_extensions 4.15.0
Uninstalling typing_extensions-4.15.0:
Successfully uninstalled typing_extensions-4.15.0
Attempting uninstall: tqdm
Found existing installation: tqdm 4.67.1
Uninstalling tqdm-4.67.1:
Successfully uninstalled tqdm-4.67.1
Attempting uninstall: shellingham
Found existing installation: shellingham 1.5.4
Uninstalling shellingham-1.5.4:
Successfully uninstalled shellingham-1.5.4
Attempting uninstall: pyyaml
Found existing installation: PyYAML 6.0.3
Uninstalling PyYAML-6.0.3:
Successfully uninstalled PyYAML-6.0.3
Attempting uninstall: packaging
Found existing installation: packaging 26.0
Uninstalling packaging-26.0:
Successfully uninstalled packaging-26.0
Attempting uninstall: idna
Found existing installation: idna 3.11
Uninstalling idna-3.11:
Successfully uninstalled idna-3.11
Attempting uninstall: hf-xet
Found existing installation: hf-xet 1.2.0
Uninstalling hf-xet-1.2.0:
Successfully uninstalled hf-xet-1.2.0
Attempting uninstall: h11
Found existing installation: h11 0.16.0
Uninstalling h11-0.16.0:
Successfully uninstalled h11-0.16.0
Attempting uninstall: fsspec
Found existing installation: fsspec 2026.1.0
Uninstalling fsspec-2026.1.0:
Successfully uninstalled fsspec-2026.1.0
Attempting uninstall: filelock
Found existing installation: filelock 3.20.3
Uninstalling filelock-3.20.3:
Successfully uninstalled filelock-3.20.3
Attempting uninstall: click
Found existing installation: click 8.3.1
Uninstalling click-8.3.1:
Successfully uninstalled click-8.3.1
Attempting uninstall: certifi
Found existing installation: certifi 2026.1.4
Uninstalling certifi-2026.1.4:
Successfully uninstalled certifi-2026.1.4
Attempting uninstall: typer-slim
Found existing installation: typer-slim 0.21.1
Uninstalling typer-slim-0.21.1:
Successfully uninstalled typer-slim-0.21.1
Attempting uninstall: httpcore
Found existing installation: httpcore 1.0.9
Uninstalling httpcore-1.0.9:
Successfully uninstalled httpcore-1.0.9
Attempting uninstall: anyio
Found existing installation: anyio 4.12.1
Uninstalling anyio-4.12.1:
Successfully uninstalled anyio-4.12.1
Attempting uninstall: httpx
Found existing installation: httpx 0.28.1
Uninstalling httpx-0.28.1:
Successfully uninstalled httpx-0.28.1
Attempting uninstall: huggingface_hub
Found existing installation: huggingface_hub 1.3.5
Uninstalling huggingface_hub-1.3.5:
Successfully uninstalled huggingface_hub-1.3.5
Successfully installed anyio-4.12.1 certifi-2026.1.4 click-8.3.1 filelock-3.20.3 fsspec-2026.1.0 h11-0.16.0 hf-xet-1.2.0 httpcore-1.0.9 httpx-0.28.1 huggingface_hub-1.3.5 idna-3.11 packaging-26.0 pyyaml-6.0.3 shellingham-1.5.4 tqdm-4.67.1 typer-slim-0.21.1 typing-extensions-4.15.0
do i need to download something else in order to get the commands?
or, on a broader note, does anyone have an idea about why this isn’t working and how i can fix it?
thanks very much
NOTA - please don’t suggest something like, “well, why not just create a virtual environment”. it has to work under this environment.