conda env 创建退出并验证交易 :/Killed

标签 conda

我正在尝试通过 conda 从现有环境创建环境在 Ubuntu18 上。我想通过导出 environment.yml 文件然后使用它来创建另一个环境来实现这一点。问题是它在创建环境之前终止而没有错误消息。

(nenv) nick {~}$ conda env export --name nenv > nenv.yml
(nenv) nick {~}$ sudo su - testusr
testusr@ip:~$ conda env create --name myenv --file /home/nick/nenv.yml 
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: / Killed

无论出于何种原因,它一直在“验证交易”上崩溃。我已经在一个安装到公共(public)路径的环境和另一个安装到用户目录的环境中尝试过这个。

一些注意事项:
  • 这是 Linux 上的多用户 anaconda 安装
  • 根 conda 环境位于/opt/conda/
  • 用户正在使用 root conda conda env create 中的二进制文件
  • conda 4.7.11

  • 我已经能够在用户之间创建共享环境,但我还想弄清楚如何使用需求文件类型方法(对于 JupyterHub 内核)为两个不同的用户拥有相同 conda 环境的副本。

    在非常有用的评论之后,我看到有很多权限错误。我可能可以从这里得到它。绝对应该考虑寻找详细标志😅如果我找到解决方案,我会在这里更新:
    ... (much more ☝️)
    DEBUG conda.gateways.disk.create:create_link(363): PermissionError(1, 'Operation not permitted')
    DEBUG conda.gateways.disk.create:create_link(367): hard-link failed. falling back to copy
      error: PermissionError(1, 'Operation not permitted')
      src: /opt/conda/pkgs/seaborn-0.9.0-py37_0/info/index.json
      dst: /home/scientist/.conda/envs/nenv/.tmp.index.json.ce11d637
    DEBUG conda.gateways.disk.create:create_link(363): PermissionError(1, 'Operation not permitted')
    DEBUG conda.gateways.disk.create:create_link(367): hard-link failed. falling back to copy
      error: PermissionError(1, 'Operation not permitted')
      src: /opt/conda/pkgs/anaconda-2019.03-py37_0/info/index.json
      dst: /home/scientist/.conda/envs/nenv/.tmp.index.json.26122231
    DEBUG conda.core.link:_get_python_version(812): found in current transaction python version 3.7.3
    done
    Verifying transaction: ...working... Killed
    

    最佳答案

    因此,答案是由于我的 anaconda 安装方式的权限问题。我最初以 root 身份将它安装到/opt/conda 这使得一些功能,包括环境创建,显然不起作用。

    有趣的是,我炸毁了服务器并重新创建了它(它有一个 ansible playbook 来设置它)并且安装(虽然仍然由 root 拥有)没有我在这个问题中问到的同样的问题。也许新版本的 conda 在创建环境时没有这个问题。

    记录我在这里所做的一切 进步;但是,如果有人从我的最新观点中知道出了什么问题,我会将其标记为正确答案!

    遵循此处的指南:https://support.anaconda.com/hc/en-us/articles/360023865574-Multi-User-Anaconda-Installation-on-Linux

    (nenv) nick {~}$ ls -al /opt/
    total 12
    drwxr-xr-x  3 root root 4096 Jul 14 10:22 .
    drwxr-xr-x 23 root root 4096 Aug 12 18:45 ..
    drwxr-xr-x 26 root root 4096 Aug 12 22:10 conda
    (nenv) nick {~}$ sudo chgrp -R developers /opt/conda/
    (nenv) nick {~}$ ls -al /opt/
    total 12
    drwxr-xr-x  3 root root       4096 Jul 14 10:22 .
    drwxr-xr-x 23 root root       4096 Aug 12 18:45 ..
    drwxr-xr-x 26 root developers 4096 Aug 12 22:10 conda
    (nenv) nick {~}$ sudo chmod 770 -R /opt/conda/
    (nenv) nick {~}$ ls -al /opt/
    total 12
    drwxr-xr-x  3 root root       4096 Jul 14 10:22 .
    drwxr-xr-x 23 root root       4096 Aug 12 18:45 ..
    drwxrwx--- 26 root developers 4096 Aug 12 22:10 conda
    

    在这一点上,根据 conda 文档,我应该能够创建环境..但我不能。现在的错误是:

    DEBUG conda.gateways.disk.permissions:make_writable(38): tried make writable but failed: /opt/conda/envs/nenv/.tmp.index.json.42434629
    PermissionError(1, 'Operation not permitted')
    DEBUG conda.gateways.disk.permissions:make_writable(38): tried make writable but failed: /opt/conda/envs/nenv/.tmp.index.json.c45bcb48
    PermissionError(1, 'Operation not permitted')
    DEBUG conda.gateways.disk.permissions:make_writable(38): tried make writable but failed: /opt/conda/envs/nenv/.tmp.index.json.11a11e9d
    PermissionError(1, 'Operation not permitted')
    DEBUG conda.core.link:_get_python_version(812): found in current transaction python version 3.7.3
    done
    Verifying transaction: ...working... Killed
    

    相当困惑,因为用户是拥有整个目录的组的一部分。

    关于conda env 创建退出并验证交易 :/Killed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57468456/

    相关文章:

    python - Heroku推送失败: Distribution version mismatch with Anaconda-Client

    python - 如何决定是否在 ubuntu 终端启动时使用 miniconda

    python - 如何在 Mac 上的 anaconda 下安装 pandas 1.1.0 并通过卡在 "Solving environment"上的 conda

    linux - conda 源停用 : bash: deactivate: No such file or directory

    python - 用户警告 : Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy is 0xe (Triggered internally at

    python - "WARNING conda.gateways.disk:exp_backoff_fn(47): Uncaught backoff with errno 41"期间 "conda install"

    conda - Jupyter实验室无法启动

    anaconda - 不同conda channel 的解释

    python - Anaconda 及包安装(pydicom)

    python - 我的项目在 conda 环境中使用什么包