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?
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.
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’