Need help with error: OSX ModuleNotFoundError: No module named 'huggingface_hub'
Hello,I am trying to confirm my install with:python -c “from huggingface_hub import model_info; print(model_info(‘gpt2’))”It returns the error:Traceback (most recent call last):File “”, line 1, inModuleNotFoundError: No module named ‘huggingface_hub’Huggingface Hub, is, AFAICT installed. Can someone point me at any documentation about this?Kind regards,kdn
2024-06-02T08:16:24Z
HiI am having the same issue:ModuleNotFoundError                       Traceback (most recent call last)Cell In[1], line 1----> 1 from huggingface_hub import InferenceClient2 client = InferenceClient()4 image = client.text_to_image(“An astronaut riding a horse on the moon.”)ModuleNotFoundError: No module named ‘huggingface_hub’when I run conda list on cmd, huggingface_hub is listed, see output below.I have tried uninstalling and reinstalling numerous times.please see the output when I run the suggested code to check installation was successful below.conda listpackages in environment at C:\Users\AppData\Local\anaconda3\envs\myenv:Name                    Version                   Build  Channelbrotli-python             1.1.0           py311h12c1d0e_1    conda-forgebzip2                     1.0.8                h2bbff1b_6ca-certificates           2024.6.2             h56e8100_0    conda-forgecertifi                   2024.2.2           pyhd8ed1ab_0    conda-forgecharset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forgecolorama                  0.4.6              pyhd8ed1ab_0    conda-forgefilelock                  3.14.0             pyhd8ed1ab_0    conda-forgefsspec                    2024.5.0           pyhff2d567_0    conda-forgegit                       2.45.1               h57928b3_0    conda-forgehuggingface_hub           0.23.2             pyhd8ed1ab_0    conda-forgeidna                      3.7                pyhd8ed1ab_0    conda-forgeintel-openmp              2021.4.0                 pypi_0    pypijinja2                    3.1.4                    pypi_0    pypijoblib                    1.4.2                    pypi_0    pypilibffi                    3.4.4                hd77b12b_1markupsafe                2.1.5                    pypi_0    pypimkl                       2021.4.0                 pypi_0    pypimpmath                    1.3.0                    pypi_0    pypinetworkx                  3.3                      pypi_0    pypinumpy                     1.26.4                   pypi_0    pypiopenssl                   3.3.0                h2466b09_3    conda-forgepackaging                 24.0               pyhd8ed1ab_0    conda-forgepillow                    10.3.0                   pypi_0    pypipip                       24.0            py311haa95532_0pysocks                   1.7.1              pyh0701188_6    conda-forgepython                    3.11.7               he1021f5_0python_abi                3.11                    2_cp311    conda-forgepyyaml                    6.0.1           py311ha68e1ae_1    conda-forgeregex                     2024.5.15                pypi_0    pypirequests                  2.32.3             pyhd8ed1ab_0    conda-forgesafetensors               0.4.3                    pypi_0    pypiscikit-learn              1.5.0                    pypi_0    pypiscipy                     1.13.1                   pypi_0    pypisentence-transformers     3.0.0                    pypi_0    pypisetuptools                69.5.1          py311haa95532_0sqlite                    3.45.3               h2bbff1b_0sympy                     1.12.1                   pypi_0    pypitbb                       2021.12.0                pypi_0    pypithreadpoolctl             3.5.0                    pypi_0    pypitk                        8.6.14               h0416ee5_0tokenizers                0.19.1                   pypi_0    pypitorch                     2.3.0                    pypi_0    pypitqdm                      4.66.4             pyhd8ed1ab_0    conda-forgetransformers              4.41.2                   pypi_0    pypityping-extensions         4.12.1               hd8ed1ab_0    conda-forgetyping_extensions         4.12.1             pyha770c72_0    conda-forgetzdata                    2024a                h04d1e81_0ucrt                      10.0.22621.0         h57928b3_0    conda-forgeurllib3                   2.2.1              pyhd8ed1ab_0    conda-forgevc                        14.2                 h2eaa2aa_1vc14_runtime              14.38.33135         h835141b_20    conda-forgevs2015_runtime            14.38.33135         h22015db_20    conda-forgewheel                     0.43.0          py311haa95532_0win_inet_pton             1.1.0              pyhd8ed1ab_6    conda-forgexz                        5.4.6                h8cc25b3_1yaml                      0.2.5                h8ffe710_2    conda-forgezlib                      1.2.13               h8cc25b3_1python -c “from huggingface_hub import model_info; print(model_info(‘gpt2’))”ModelInfo(id=‘openai-community/gpt2’, author=‘openai-community’, sha=‘607a30d783dfa663caf39e06633721c8d4cfcd7e’, created_at=datetime.datetime(2022, 3, 2, 23, 29, 4, tzinfo=datetime.timezone.utc), last_modified=datetime.datetime(2024, 2, 19, 10, 57, 45, tzinfo=datetime.timezone.utc), private=False, gated=False, disabled=False, downloads=10803905, likes=1974, library_name=‘transformers’, tags=[‘transformers’, ‘pytorch’, ‘tf’, ‘jax’, ‘tflite’, ‘rust’, ‘onnx’, ‘safetensors’, ‘gpt2’, ‘text-generation’, ‘exbert’, ‘en’, ‘doi:10.57967/hf/0039’, ‘license:mit’, ‘autotrain_compatible’, ‘endpoints_compatible’, ‘text-generation-inference’, ‘region:us’], pipeline_tag=‘text-generation’, mask_token=None, card_data={‘language’: ‘en’, ‘license’: ‘mit’, ‘library_name’: None, ‘tags’: [‘exbert’], ‘base_model’: None, ‘datasets’: None, ‘metrics’: None, ‘eval_results’: None, ‘model_name’: None}, widget_data=[{‘text’: ‘My name is Julien and I like to’}, {‘text’: ‘My name is Thomas and my main’}, {‘text’: ‘My name is Mariama, my favorite’}, {‘text’: ‘My name is Clara and I am’}, {‘text’: ‘My name is Lewis and I like to’}, {‘text’: ‘My name is Merve and my favorite’}, {‘text’: ‘My name is Teven and I am’}, {‘text’: ‘Once upon a time,’}], model_index=None, config={‘architectures’: [‘GPT2LMHeadModel’], ‘model_type’: ‘gpt2’, ‘tokenizer_config’: {}}, transformers_info=TransformersInfo(auto_model=‘AutoModelForCausalLM’, custom_class=None, pipeline_tag=‘text-generation’, processor=‘AutoTokenizer’), siblings=[RepoSibling(rfilename=‘.gitattributes’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘64-8bits.tflite’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘64-fp16.tflite’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘64.tflite’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘README.md’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘config.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘flax_model.msgpack’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘generation_config.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘merges.txt’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘model.safetensors’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/config.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/decoder_model.onnx’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/decoder_model_merged.onnx’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/decoder_with_past_model.onnx’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/generation_config.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/merges.txt’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/special_tokens_map.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/tokenizer.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/tokenizer_config.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘onnx/vocab.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘pytorch_model.bin’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘rust_model.ot’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘tf_model.h5’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘tokenizer.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘tokenizer_config.json’, size=None, blob_id=None, lfs=None), RepoSibling(rfilename=‘vocab.json’, size=None, blob_id=None, lfs=None)], spaces=[‘open-llm-leaderboard/open_llm_leaderboard’, ‘microsoft/HuggingGPT’, ‘Gustavosta/MagicPrompt-Stable-Diffusion’, ‘shi-labs/Versatile-Diffusion’, ‘optimum/llm-perf-leaderboard’, ‘h2oai/h2ogpt-chatbot’, ‘microsoft/Promptist’, ‘yizhangliu/Grounded-Segment-Anything’, ‘aliabid94/AutoGPT’, ‘wangrongsheng/ChatPaper’, ‘h2oai/h2ogpt-chatbot2’, ‘OFA-Sys/OFA-Image_Caption’, ‘Manmay/tortoise-tts’, ‘ShiwenNi/ChatReviewer’, ‘OpenMotionLab/MotionGPT’, ‘Intel/low_bit_open_llm_leaderboard’, ‘m-ric/beam_search_visualizer’, ‘exbert-project/exbert’, ‘flax-community/image-captioning’, ‘doevent/Stable-Diffusion-prompt-generator’, ‘eduagarcia/open_pt_llm_leaderboard’, ‘treadon/prompt-fungineer-355M’, ‘SeaLLMs/SeaLLM-7B’, ‘nateraw/lavila’, ‘yizhangliu/Text-to-Image’, ‘BAAI/open_cn_llm_leaderboard’, ‘gsaivinay/open_llm_leaderboard’, ‘deepklarity/poster2plot’, ‘EleutherAI/magma’, ‘akhaliq/CLIP_prefix_captioning’, ‘FrankZxShen/so-vits-svc-models-ba’, ‘OFA-Sys/OFA-Visual_Grounding’, ‘maxmax20160403/sovits5.0’, ‘OFA-Sys/OFA-vqa’, ‘Gustavosta/MagicPrompt-Dalle’, ‘phenomenon1981/MagicPrompt-Stable-Diffusion’, ‘OFA-Sys/OFA-Generic_Interface’, ‘johko/capdec-image-captioning’, ‘hkunlp/Binder’, ‘aubmindlab/Arabic-NLP’, ‘bipin/image2story’, ‘ShiwenNi/ChatResponse’, ‘LilyF/Generate_Text_and_Audio’, ‘Omnibus/Chatbot-Compare’, ‘TMElyralab/MuseTalk’, ‘society-ethics/model-card-regulatory-check’, ‘Catmeow/AI_story_writing’, ‘hahahafofo/image2text_prompt_generator’, ‘ICML2022/OFA’, ‘thirdai/BOLT2.5B’, ‘mshukor/UnIVAL’, ‘sohaibcs1/Image-to-Text-Summary’, ‘aliabid94/GPT-Golf’, ‘Hello-SimpleAI/chatgpt-detector-ling’, ‘llizhx/TinyGPT-V’, ‘SeaLLMs/SeaLLM-7B-v2.5’, ‘FrankZxShen/so-vits-svc-models-pcr’, ‘architext/Architext_deployed’, ‘kmacdermid/RpgRoomGenerator’, ‘SeViLA/SeViLA’, ‘Dagfinn1962/stablediffusion-models’, ‘RitaParadaRamos/SmallCapDemo’, ‘AnimaLab/bias-test-gpt-pairs’, ‘stanfordnlp/Backpack-Demo’, ‘sasha/BiasDetection’, ‘gsarti/pecore’, ‘sasha/WinoBiasCheck’, ‘GTBench/GTBench’, ‘ccolas/TastyPiano’, ‘BoomerangGirl/MagicPrompt-Stable-Diffusion’, ‘dromerosm/gpt-info-extraction’, ‘hahahafofo/prompt_generator’, ‘liyucheng/selective_context’, ‘zeno-ml/chatbot-report’, ‘lfoppiano/document-qa’, ‘Hellisotherpeople/HF-SHAP’, ‘ethzanalytics/gpt2-xl-conversational’, ‘taesiri/HuggingGPT-Lite’, ‘taka-yamakoshi/tokenizer-demo’, ‘autonomous019/image_story_generator’, ‘shangdatalab-ucsd/LDB’, ‘Guinnessgshep/AI_story_writing’, ‘SeaLLMs/SeaLLM-7B-v2’, ‘gagan3012/ViTGPT2’, ‘luis112/text-generation-webui’, ‘abdullahmeda/detect-ai-text’, ‘yhavinga/dutch-tokenizer-arena’, ‘BigSalmon/InformalToFormal’, ‘xzuyn/Token-Count-Comparison’, ‘alistairmcleay/cambridge-masters-project’, ‘codeparrot/apps_metric’, ‘Catmeow/Text_Generation_Fine_Tune’, ‘j43fer/MagicPrompt-Stable-Diffusion’, ‘Daniton/MagicPrompt-Stable-Diffusion’, ‘ashhadahsan/ai-book-generator’, ‘Chakshu123/sketch-colorization-with-hint’, ‘koajoel/PolyFormer’, ‘felixz/open_llm_leaderboard’, ‘ehristoforu/Rensor’, ‘Kaludi/Stable-Diffusion-Prompt-Generator_App’], safetensors=SafeTensorsInfo(parameters={‘F32’: 137022720}, total=137022720))