You have two Python environments, one based on conda and other installed by VS. And PyTorch is installed in the first one. Since you are using VS Code, you could first install the Python extension (Press ctrl+shift+x and type in Python) and then in the left side of the status bar, it will let you select the preferred python environment.