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

2021/9/27 22:10:42

本文主要是介绍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博客



这篇关于conda安装python包出错:Collecting package metadata: failed NotWritableError的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程