Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll

Problem:

Traceback (most recent call last):
File “C:\Users\USER\workspace\query.py”, line 20, in <module>
model = HuggingFaceEmbeddings(model_name=”BAAI/bge-large-zh-v1.5″)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…


This content originally appeared on DEV Community and was authored by Danny Chan

Problem:

Traceback (most recent call last):
  File "C:\Users\USER\workspace\query.py", line 20, in <module>
    model = HuggingFaceEmbeddings(model_name="BAAI/bge-large-zh-v1.5")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain_huggingface\embeddings\huggingface.py", line 53, in __init__
    import sentence_transformers  # type: ignore[import]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\sentence_transformers\__init__.py", line 7, in <module>
    from sentence_transformers.cross_encoder.CrossEncoder import CrossEncoder
  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\sentence_transformers\cross_encoder\__init__.py", line 1, in <module>
    from .CrossEncoder import CrossEncoder
  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\sentence_transformers\cross_encoder\CrossEncoder.py", line 7, in <module>
    import torch
  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\__init__.py", line 148, in <module>
    raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.



Solution:

Step 1:
download visual studio

Step 2:
install desktop development with c++

Step 3:
install MSVC V143 VS 2022 C++ x64/x86


This content originally appeared on DEV Community and was authored by Danny Chan


Print Share Comment Cite Upload Translate Updates
APA

Danny Chan | Sciencx (2024-08-11T08:46:25+00:00) Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll. Retrieved from https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/

MLA
" » Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll." Danny Chan | Sciencx - Sunday August 11, 2024, https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/
HARVARD
Danny Chan | Sciencx Sunday August 11, 2024 » Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll., viewed ,<https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/>
VANCOUVER
Danny Chan | Sciencx - » Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/
CHICAGO
" » Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll." Danny Chan | Sciencx - Accessed . https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/
IEEE
" » Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll." Danny Chan | Sciencx [Online]. Available: https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/. [Accessed: ]
rf:citation
» Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll | Danny Chan | Sciencx | https://www.scien.cx/2024/08/11/fix-python312libsite-packagestorchlibfbgemm-dll-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.