It might be that your jupyter notebook is pointing to a different python path than the one you have PyTorch installed on.
You can run
import sys
sys.executable

to check which python is being used in Jupyter.
I use conda to manage my environments and the output for the above code looks similar to this
'/Users/user_name/anaconda/envs/env_name/bin/python'