1. 程式人生 > >安裝pytorch一直提示下面類似的錯誤,忙活了一晚上,後來終於解決了 出錯修改 ninja

安裝pytorch一直提示下面類似的錯誤,忙活了一晚上,後來終於解決了 出錯修改 ninja

ERROR conda.core.link:_execute(502): An error occurred while installing package '<unknown>::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/<Your username> user. Remove or take backup of the already installed Anaconda (/home/<user>/anaconda3). With normal mode install anaconda ( bash conda_installer_script

) .

Check .bashrc for this line and validate it.

export PATH="/home/<username>/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 <path_to_conda>/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