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

OSError: [WinError 126] Error loading a PyTorch file on Windows #42

Open
tanvircr7 opened this issue Jan 29, 2025 · 1 comment
Open

Comments

@tanvircr7
Copy link

My OS is Windows 11
Poetry - version 1.8.4
Poe the Poet - version: 0.32.2

I have run powershell with
poetry shell

When I run
poetry poe run-digital-data-etl-maxime

This error statement appears:
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

The entire result from the command

Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\tanvi\python_ws\LLM_twin\LLM-Engineers-Handbook\tools\run.py", line 7, in <module> from llm_engineering import settings File "C:\Users\tanvi\python_ws\LLM_twin\LLM-Engineers-Handbook\llm_engineering\__init__.py", line 1, in <module> from llm_engineering import application, domain, infrastructure File "C:\Users\tanvi\python_ws\LLM_twin\LLM-Engineers-Handbook\llm_engineering\application\__init__.py", line 1, in <module> from . import utils File "C:\Users\tanvi\python_ws\LLM_twin\LLM-Engineers-Handbook\llm_engineering\application\utils\__init__.py", line 1, in <module> from . import misc File "C:\Users\tanvi\python_ws\LLM_twin\LLM-Engineers-Handbook\llm_engineering\application\utils\misc.py", line 3, in <module> from transformers import AutoTokenizer File "C:\Users\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\Lib\site-packages\transformers\__init__.py", line 26, in <module> from . import dependency_versions_check File "C:\Users\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\Lib\site-packages\transformers\dependency_versions_check.py", line 16, in <module> from .utils.versions import require_version, require_version_core File "C:\Users\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\Lib\site-packages\transformers\utils\__init__.py", line 34, in <module> from .generic import ( File "C:\Users\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\Lib\site-packages\transformers\utils\generic.py", line 462, in <module> import torch.utils._pytree as _torch_pytree File "C:\Users\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\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\tanvi\AppData\Local\pypoetry\Cache\virtualenvs\llm-engineering-oCvMHcwX-py3.11\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

@tanvircr7 tanvircr7 changed the title OSError: [WinError 126] Error loading a file OSError: [WinError 126] Error loading a PyTorch file on Windows Jan 29, 2025
@dmitriy-kisil
Copy link
Contributor

Hi! Please use torch version 2.2.2 - it should solve the issue. In order to achieve that open pyproject.toml file and add this line under [tool.poetry.dependencies]
torch = "2.2.2"
After that you would need update poetry so it will reinstall torch.
I faced exactly the same error and setting this version helped. Let me know if it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants