安装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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值