当我尝试使用以下命令行将pytorch版本更新为0.4时
conda install pytorch=0.4.0 -c pytorch
我遇到以下错误:
Solving environment: done
##Package Plan##
environment location: /anaconda
added / updated specs:
- pytorch=0.4.0
The following NEW packages will be INSTALLED:
blas: 1.0-mkl
intel-openmp: 2018.0.3-0
libcxx: 4.0.1-h579ed51_0
libcxxabi: 4.0.1-hebd6815_0
libgfortran: 3.0.1-h93005f0_2
mkl_fft: 1.0.4-py27h5d10147_1
mkl_random: 1.0.1-py27h5d10147_1
ninja: 1.8.2-py27h04f5b5a_1
numpy-base: 1.15.0-py27h8a80b8c_0
pytorch: 0.4.0-py27_cuda0.0_cudnn0.0_1 pytorch
The following packages will be UPDATED:
mkl: 2017.0.3-0 --> 2018.0.3-1
numpy: 1.13.1-py27_0 --> 1.15.0-py27h648b28d_0
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(502): An error occurred while uninstalling package 'defaults::numpy-1.13.1-py27_0'.
OSError(13, 'Permission denied')
Attempting to roll back.
Rolling back transaction: done
OSError(13, 'Permission denied')
我在网上看到我应该使用chown功能,但是我不确定如何使用它。我该怎么办?
答案 0 :(得分:1)
除非多个用户使用相同的anaconda环境,否则您应该已将anaconda安装到主目录,但这是一个快速修复程序,终端类型:
sudo chown -R USERNAME /anaconda
然后更新您的conda,此命令会将根目录下的anaconda目录的所有权转让给您的用户。如果多个用户需要使用相同的anaconda环境,请按照以下步骤操作
# create a new user group
sudo groupadd anacondausers
# add all users to group
sudo usermod -a -G anacondausers USER1
sudo usermod -a -G anacondausers USER2
# make your group owner of folder
sudo chown -R :anacondausers /anaconda