Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: no module named 'transformers'

This is my first post and I am new to coding, so please let me know if you need more information. I have been running some AI to generate artwork and it has been working, but when I reloaded it the python script won't work and it is now saying "No module named 'transformers'". Can anyone help me out? It was when I upgraded to Google Colab Pro that I started to encounter issues although I am not sure why that would make a difference.

ModuleNotFoundError

enter image description here

like image 689
Khaleel Shazada Avatar asked Aug 31 '25 17:08

Khaleel Shazada


2 Answers

Probably it is because you have not installed in your (new, since you've upgraded to colabs pro) session the library transformers. Try to run as first cell the following: !pip install transformers (the "!" at the beginning of the instruction is needed to go into "terminal mode" ). This will download the transformers package into the session's environment.

like image 129
chattershuts Avatar answered Sep 02 '25 05:09

chattershuts


Assuming you are referring to the module here https://pypi.org/project/transformers/ you need to install transformers with pip

pip install transformers
like image 33
Tyler Robbins Avatar answered Sep 02 '25 06:09

Tyler Robbins