Thanks for the answer!
It works on the integrated terminal, so I can use it, but on the VS Code editor it still doesn’t work. I’m attaching the pics of the environment I am in ~/opt/anaconda3/envs/pytorch/bin/python (which should be the same as in the terminal), and still raises the “No module named torch” error.
Thanks again David!