# ModuleNotFoundError: No module named 'transformers.utils'

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%3E%5C
**Category:** Beginners\
**Created:** [August 22, 2024, 6:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593 "2024-08-22T18:53:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LFEsDungeon](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@LFEsDungeon](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLFEsDungeon)%5C
**Post date:** [August 22, 2024, 6:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%2F1 "2024-08-22T18:53:03Z")

</div>

VS CODE  
I am trying to run code that uses BlipProcessor, BlipForConditionalGeneration however whenever I run it The following is outputted:

[Running] python -u “c:\Users\joshu\Desktop\AI\_project.venv\first.py”  
Traceback (most recent call last):  
File “c:\Users\joshu\Desktop\AI\_project.venv\first.py”, line 3, in   
from transformers import BlipProcessor, BlipForConditionalGeneration  
File “C:\Users\joshu\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\__init_\_.py”, line 26, in   
from . import dependency\_versions\_check  
File “C:\Users\joshu\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\dependency\_versions\_check.py”, line 16, in   
from .utils.versions import require\_version, require\_version\_core  
ModuleNotFoundError: No module named ‘transformers.utils’

[Done] exited with code=1 in 1.077 seconds

I have installed pip and the transformers using pip install transformers. I have tried then installing the transformers through the git link I have tried updating the transformers and the code still doesn’t run. Is there any solutions?

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/52583_2.png) [@mahmutc](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmahmutc)%5C
**Post date:** [August 23, 2024, 8:35am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%2F2 "2024-08-23T08:35:14Z")

</div>

hi @LFEsDungeon  
Can you please run these and share the output:

```auto
pip freeze
python -c "import transformers.utils.versions"

```

To reinstall the transformers, you can run the following:  
`pip install --force-reinstall "transformers"`

---

<div class="post-metadata">

**Author:** ![LFEsDungeon](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@LFEsDungeon](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLFEsDungeon)%5C
**Post date:** [August 24, 2024, 10:51pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%2F3 "2024-08-24T22:51:23Z")

</div>

The output to the pip freeze command was:

(.venv) PSC:\Users\joshu\Desktop\AI\_project\> pip freeze  
absl-py==2.1.0  
aiofiles==23.2.1  
aiohappyeyeballs==2.4.0  
aiohttp==3.10.5  
aiosignal==1.3.1  
altair==5.4.0  
annotated-types==0.7.0  
anyio==4.4.0  
attrs==24.2.0  
blinker==1.8.2  
cachetools==5.5.0  
certifi==2024.7.4  
charset-normalizer==3.3.2  
click==8.1.7  
colorama==0.4.6  
contourpy==1.2.1  
cycler==0.12.1  
datasets==2.21.0  
dill==0.3.8  
docker-pycreds==0.4.0  
fastapi==0.112.1  
ffmpy==0.4.0  
filelock==3.15.4  
fonttools==4.53.1  
frozenlist==1.4.1  
fsspec==2024.6.1  
gitdb==4.0.11  
GitPython==3.1.43  
gradio==4.42.0  
gradio\_client==1.3.0  
grpcio==1.65.5  
h11==0.14.0  
httpcore==1.0.5  
httpx==0.27.0  
huggingface-hub==0.24.6  
idna==3.8  
importlib\_resources==6.4.4  
Jinja2==3.1.4  
joblib==1.4.2  
jsonschema==4.23.0  
jsonschema-specifications==2023.12.1  
kiwisolver==1.4.5  
Markdown==3.7  
markdown-it-py==3.0.0  
MarkupSafe==2.1.5  
matplotlib==3.9.2  
mdurl==0.1.2  
mpmath==1.3.0  
multidict==6.0.5  
multiprocess==0.70.16  
narwhals==1.5.2  
networkx==3.3  
numpy==2.1.0  
orjson==3.10.7  
packaging==24.1  
pandas==2.2.2  
pillow==10.4.0  
platformdirs==4.2.2  
protobuf==5.27.3  
psutil==6.0.0  
pyarrow==17.0.0  
pydantic==2.8.2  
pydantic\_core==2.20.1  
pydeck==0.9.1  
pydub==0.25.1  
Pygments==2.18.0  
pyparsing==3.1.2  
python-dateutil==2.9.0.post0  
python-multipart==0.0.9  
pytz==2024.1  
PyYAML==6.0.2  
referencing==0.35.1  
regex==2024.7.24  
requests==2.32.3  
rich==13.7.1  
rpds-py==0.20.0  
ruff==0.6.2  
safetensors==0.4.4  
scikit-learn==1.5.1  
scipy==1.14.1  
semantic-version==2.10.0  
sentencepiece==0.2.0  
sentry-sdk==2.13.0  
seqeval==1.2.2  
setproctitle==1.3.3  
setuptools==73.0.1  
shellingham==1.5.4  
simpletransformers==0.70.1  
six==1.16.0  
smmap==5.0.1  
sniffio==1.3.1  
starlette==0.38.2  
streamlit==1.37.1  
sympy==1.13.2  
tenacity==8.5.0  
tensorboard==2.17.1  
tensorboard-data-server==0.7.2  
tensorboardX==2.6.2.2  
threadpoolctl==3.5.0  
tokenizers==0.19.1  
toml==0.10.2  
tomlkit==0.12.0  
torch==2.4.0  
torchaudio==2.4.0  
torchvision==0.19.0  
tornado==6.4.1  
tqdm==4.66.5  
typer==0.12.4  
typing\_extensions==4.12.2  
tzdata==2024.1  
urllib3==2.2.2  
uvicorn==0.30.6  
wandb==0.17.7  
watchdog==4.0.2  
websockets==12.0  
Werkzeug==3.0.4  
xxhash==3.5.0  
yarl==1.9.4

The output to the python -c “import transformers.utils.versions” command was:

(.venv) PS C:\Users\joshu\Desktop\AI\_project\> python -c “import transformers.utils.versions”  
Traceback (most recent call last):  
File “”, line 1, in   
File “C:\Users\joshu\Desktop\AI\_project.venv\Lib\site-packages\transformers\__init_\_.py”, line 26, in   
from . import dependency\_versions\_check  
File “C:\Users\joshu\Desktop\AI\_project.venv\Lib\site-packages\transformers\dependency\_versions\_check.py”, line 16, in   
from .utils.versions import require\_version, require\_version\_core  
File “C:\Users\joshu\Desktop\AI\_project.venv\Lib\site-packages\transformers\utils\__init_\_.py”, line 34, in   
from .generic import (  
File “C:\Users\joshu\Desktop\AI\_project.venv\Lib\site-packages\transformers\utils\generic.py”, line 462, in   
import torch.utils.\_pytree as _torch\_pytree  
File "C:\Users\joshu\Desktop\AI\_project.venv\Lib\site-packages\torch\_init_.py", line 148, in   
raise err  
OSError: [WinError 126] The specified module could not be found. Error loading “C:\Users\joshu\Desktop\AI\_project.venv\Lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies.

I also tried to reinstalled transformers and the output was the same . IT did come up with an error that said:

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.  
torchvision 0.19.0 requires numpy\<2, but you have numpy 2.1.0 which is incompatible.

Thanks for taking the time out of your day to help me.

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/52583_2.png) [@mahmutc](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmahmutc)%5C
**Post date:** [August 25, 2024, 8:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%2F4 "2024-08-25T20:11:50Z")

</div>

hi  
If possible, can you please create a new virtual environment and run `python.exe -m pip install --upgrade pip` before installing transformers?

---

<div class="post-metadata">

**Author:** ![LFEsDungeon](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@LFEsDungeon](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FLFEsDungeon)%5C
**Post date:** [August 27, 2024, 5:28pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%2F5 "2024-08-27T17:28:51Z")

</div>

I attempted this solution as well and had no luck. The same error message:

[Running] python -u “c:\Users\joshu\Desktop\AI\_project.venv\first.py”  
Traceback (most recent call last):  
File “c:\Users\joshu\Desktop\AI\_project.venv\first.py”, line 3, in  
from transformers import BlipProcessor, BlipForConditionalGeneration  
File “C:\Users\joshu\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\__init_ \_.py”, line 26, in  
from . import dependency\_versions\_check  
File “C:\Users\joshu\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\transformers\dependency\_versions\_check.py”, line 16, in  
from .utils.versions import require\_version, require\_version\_core  
ModuleNotFoundError: No module named ‘transformers.utils’

was output

---

<div class="post-metadata">

**Author:** ![ArgyleR](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@ArgyleR](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FArgyleR)%5C
**Post date:** [September 9, 2024, 10:17am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmodulenotfounderror-no-module-named-transformers-utils%2F103593%2F6 "2024-09-09T10:17:52Z")

</div>

Hi! I recently had this exact error, I had to enable long paths on windows to allow the transformers package to be correctly installed. Follow this guide here: [Maximum Path Length Limitation - Win32 apps | Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later)

From the link: Computer Configuration \> Administrative Templates \> System \> Filesystem \> Enable Win32 long paths \> Apply and click OK
