【问题标题】:Elastic Beanstalk link/alias cmake3 to cmakeElastic Beanstalk 链接/别名 cmake3 到 cmake
【发布时间】:2021-12-07 22:05:56
【问题描述】:

我已经通过 yum 在我的 AWS Elastic Beanstalk 实例上安装了 cmake3:

packages: 
  yum:
    cmake3: []

但是,当运行需要 cmake 的 pip 安装时,我收到一个错误:

FileNotFoundError: [Errno 2] No such file or directory: 'cmake': 'cmake'

如何为 cmake 取别名 cmake3?我已经尝试了以下方法,它会导致相同的错误消息。

container_commands:
  01_link_cmake:
    command: "ln -s /usr/bin/cmake3 /usr/bin/cmake"

我不安装cmake: []的原因是因为我需要版本3。

【问题讨论】:

    标签: amazon-web-services cmake amazon-elastic-beanstalk sudo


    【解决方案1】:

    我已经解决了。我意识到 pip 包安装发生在 ln -s container 命令之前。因此,即使我的别名正在发生,但它在此过程中发生得太晚了。

    相反,我需要做的是

    container_commands:
      01_link_cmake:
        command: ln -s /usr/bin/cmake3 /usr/bin/cmake
      02_upgrade_pip:
        command: "python -m pip install --upgrade pip"
        leader_only: true
      03_install_package:
        command: "python -m pip install <package that requires cmake>"
        leader_only: true
    

    【讨论】:

      猜你喜欢
      • 2020-10-24
      • 1970-01-01
      • 2021-07-28
      • 2015-09-07
      • 2017-12-25
      • 2015-04-13
      • 2016-08-24
      • 2020-11-21
      • 2016-02-15
      相关资源
      最近更新 更多