ERROR conda.core.link

When I install pytorch of cpu version in ubuntu 16.04 with conda, there is an error:

ERROR conda.core.link:_execute(481): An error occurred while installing package ‘defaults::ninja-1.8.2-py36h6bb024c_1’.

It means that install ninja need root permission, but when I execute sudo conda, It remind me that
image
so could anyone give me some advice on it?

It sounds like you’re trying to install conda packages into the root environment and you don’t have permissions to do that. You should check to see where conda is installed and verify this.

I would recommend one of the following to resolve the issue:

  1. setting up a conda environment: https://conda.io/docs/user-guide/tasks/manage-environments.html and installing things into the environment. This is good practice and helps separate multiple projects
  2. reinstall conda somewhere in your home directory where you have permissions to modify it