安装pytorch一直提示下面类似的错误,忙活了一晚上,后来终于解决了 出错修改 ninja

ERROR conda.core.link:_execute(502): An error occurred while installing package '::ninja-1.7.2-0'.
PermissionError(13, 'Permission denied')

这样执行来解决:

sudo env "PATH=$PATH" conda install pytorch torchvision

 

It's Permission denied, So just sudo chown -R frazier:frazier /home/frazier/anaconda3

PS: change 'frazier' to your user name.

 

You have installed Anaconda with sudo or root user. You need to install it with normal ubuntu/ user. Remove or take backup of the already installed Anaconda (/home//anaconda3). With normal mode install anaconda ( bash conda_installer_script ) .

Check .bashrc for this line and validate it.

export PATH="/home//anaconda3/bin:$PATH"

If not add it with proper anaconda path .

Reload .bashrc file and check conda is working by conda list command.

Now you can do conda update conda

shareimprove this answer

answered Mar 10 at 3:08

Manish Verma

607616

  • Please note that this export PATH thing is no longer the way to proceed for conda>=4.4. It should be replaced by source /etc/profile.d/conda.sh. – FabienP Jun 16 at 19:41

add a comment

up vote 0 down vote

All conda commands must be run without super user privileges. That's why sudo conda command doesn't work.

You may have run conda installation bush file with super user privileges while installing. The user (david) running conda doesn't have write permissions to paths(/home/david/anaconda3) it needs to modify in the environment, then conda can't do anything. To solve this problem you need to change permissions to paths (/home/david/anaconda3).

To change permissions to paths (/home/user/anaconda3) using:

sudo chown -R user /home/user/anaconda3
sudo env "PATH=$PATH" conda update conda

你可能感兴趣的:(pytorch)