First, avtivate the environment. You can use this command:
conda activate pytorch
Then install a package named ipykernel after you change to the environment you need.
conda install ipykernel
Finally, add it to your jupyter such as:
python -m ipykernel install --user --name pytorch --display-name "pytorch"