Mac M1 Colab ImportError

pipe = StableDiffusionPipeline.from_pretrained(model_id).to(device)
ImportError:
StableDiffusionPipeline requires the transformers library but it was not found in your environment. You can install it with pip: pip install transformers
But I have already installed transformers, and I can see the details about it. So how to deal with this question?