我在运行Linux CentOS 7的笔记本电脑上通过Miniconda安装了Conda。
如果我运行命令conda update conda
,我会收到以下错误:
conda update conda
Solving environment: failed
NotWritableError: The current user does not have write permissions to a required path.
path: /path/to/custom/dir/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 /path/to/custom/dir/pkgs/urls.txt
In general, it's not advisable to use 'sudo conda'.
我不知道如何解决这个问题;我也问过Bioconda GitHub page,但是没有人回复。
有关如何解决此问题的任何建议?感谢
答案 0 :(得分:1)
这在conda问题#7267(https://github.com/conda/conda/issues/7267)中进行了讨论。
您可能已使用sudo登录,也许以sudo -u davide bash
身份登录?
如果是这样,那么以下命令将显示SUDO_COMMAND作为用于成为用户的命令,以及SUDO_USER,SUDO_UID和SUDO_GID:
$ set | grep SUDO
您可以改为使用sudo su - davide
来获得没有SUDO定义的干净上下文。
在通过ansible管理共享的conda环境时,我遇到了相同的问题。我的解决方案是使用以下内容作为conda程序包所有者:
- name: update conda environment
command: conda update -y --all
become: yes
become_user: conda
become_method: su
在群集上共享anaconda安装是否是一个好主意。