Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

huggingface_hub cannot import name 'hf_hub_download' from 'huggingface_hub' #2089

Open
stefanolatini opened this issue Mar 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@stefanolatini
Copy link

Describe the bug

I have the latest version o huggingface_hub.
In python console I can import huggingface_hub but not its sumbodule `hf_hub_download``

Thanks for the attention.

Reproduction

❯ python
Python 3.11.7 (main, Dec 15 2023, 12:09:04) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import huggingface_hub
>>> from huggingface_hub import hf_hub_download
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'hf_hub_download' from 'huggingface_hub' (/usr/local/anaconda3/lib/python3.11/site-packages/huggingface_hub/__init__.py)
>>>

Logs

No response

System info

I can not even launch the command for this Issue "system Info" description


>>> from huggingface_hub import dump_environment_info
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'dump_environment_info' from 'huggingface_hub' (/usr/local/anaconda3/lib/python3.11/site-packages/huggingface_hub/__init__.py)
>>> dump_environment_info()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'dump_environment_info' is not defined
>>>
@stefanolatini stefanolatini added the bug Something isn't working label Mar 6, 2024
@Wauplin
Copy link
Contributor

Wauplin commented Mar 6, 2024

Hi @stefanolatini, I suspect there's something wrong in your setup. Could you upgrade to a recent version?

pip install --upgrade huggingface_hub

If this doesn't work, you can uninstall + reinstall it completely:

pip uninstall huggingace_hub
pip install huggingface_hub

Both hf_hub_download and dump_environment_info have been around for a long time (>12 months) so you should be able to import them correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants