![收集包元数据(current_repodata.json):失败 NotWritableError:当前用户对所需路径没有写权限](https://linux22.com/image/1170745/%E6%94%B6%E9%9B%86%E5%8C%85%E5%85%83%E6%95%B0%E6%8D%AE%EF%BC%88current_repodata.json%EF%BC%89%EF%BC%9A%E5%A4%B1%E8%B4%A5%20NotWritableError%EF%BC%9A%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E5%AF%B9%E6%89%80%E9%9C%80%E8%B7%AF%E5%BE%84%E6%B2%A1%E6%9C%89%E5%86%99%E6%9D%83%E9%99%90.png)
当我尝试安装任何库(例如 pandas)时,甚至当我尝试使用 . 安装干净的包时,conda install anaconda-clean
它会出现错误:
Collecting package metadata (current_repodata.json): failed
NotWritableError: The current user does not have write permissions to a required path.
path: /home/parth/.conda/pkgs/urls.txt
uid: 1000
gid: 1000
If you feel that permissions on this path are set incorrectly, you can manually
change them by executing
$ sudo chown 1000:1000 /home/parth/.conda/pkgs/urls.txt
In general, it's not advisable to use 'sudo conda'.
答案1
由于您没有权限,我也收到此错误。康达命令无法与 sudo 一起使用。为了修复此错误,我通过更改所有权授予了 anaconda 文件夹权限。
$ sudo chown -R myuser /home/myuser/anaconda3