The sure proof way would be to
sudo /home/ubuntu/anaconda3/bin/conda install pytorch torchvision -c pytorch
But this is venturing in some pretty messy territory.
I’d suggest 2 alternative options,


The best way to do this is do a user installation of anaconda3
such that which conda returns $HOME/anaconda3/bin/conda


The other way is to do
conda create -n yourenvname python=x.x
and call
conda activate yourenvname
when you wish to use your environment


Both options will separate you completely from the anaconda in /home/ubuntu/anaconda3. Probably someone has been tempering with it. Best to restrict the management of environments away from others thereby preventing these sort of errors from happening