humza:

If I import “from torchvision.transforms import transforms as T” in a console it runs fine.


This would point to a broken installation in the other environment you are using (I don’t know how you are executing the script in the failing case).