Not able to install detectron2 and deepspeed libraries

While trying to install detectron2 and deepspeed I’m getting below errors :


I have followed the steps to install detectron2 from here (Installation — detectron2 0.6 documentation),
Although the above error says that I do not have a “torch” module, I have already installed it and it still doesn’t work.

This is the same case with installing deepspeed:

My python version is 3.9 and torch version is :
image

Please let me know what might me the issue here.