DEV Community

Cover image for Fix: Python312\Lib\site-packages\torch\lib\fbgemm.dll
Danny Chan
Danny Chan

Posted on

13 1 1 1 1

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")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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.


Enter fullscreen mode Exit fullscreen mode



Solution:

Step 1:
download visual studio

Image description

Image description

Step 2:
install desktop development with c++

Image description

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

Image description

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay