编程语言
首页 > 编程语言> > conda安装python包出错:Collecting package metadata: failed NotWritableError

conda安装python包出错:Collecting package metadata: failed NotWritableError

作者:互联网

最近在服务器上用conda命令安装python依赖包时总是报错,如下:

Collecting package metadata (current_repodata.json): failed

NotWritableError: The current user does not have write permissions to a required path.
  path: /opt/anaconda3/pkgs/cache/8f77de01.json
  uid: 984
  gid: 984

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 984:984 /opt/anaconda3/pkgs/cache/8f77de01.json

In general, it's not advisable to use 'sudo conda'.

 原因:

创建Anaconda时使用了root权限,所以在普通用户使用时就会报错,提示对Anaconda没权限修改。

解决办法:

给本用户Anaconda文件夹的权限:cd到anaconda3文件夹所在的路径(我的是/opt),运行

$ sudo chown -R username anaconda3  #username替换为自己用户名

之后就可以正常安装python包啦!

参考链接:

conda创建环境报错:NotWritableError: The current user does not have write permissions to a required path._HaotianYan的博客-CSDN博客

标签:Collecting,sudo,anaconda3,python,package,984,conda,path,报错
来源: https://blog.csdn.net/BaiHang111/article/details/120518003