Make sure that you are running the script from the right environment (the conda env name should be shown in the terminal).
You could also check, if torch is found via conda list | grep torch, which should output the install torch version.