【问题标题】:How can I get the python xmlsec library running on Pivotal Cloud Foundry如何让 python xmlsec 库在 Pivotal Cloud Foundry 上运行
【发布时间】:2019-02-09 16:18:53
【问题描述】:

我正在尝试让 python 模块 python3-saml 在使用标准 python buildpack 和 cflinuxfs2 堆栈的云铸造应用程序上工作。该模块依赖于 python xmlsec 模块作为依赖项,但不幸的是我遇到了让它工作的问题。

我已经整理了一个需求文件并提供了所有 python 依赖项,但是当我运行“cf push”命令时,我不断收到以下错误。

            Running setup.py install for xmlsec: started
              Running setup.py install for xmlsec: finished with status 'error'
              Complete output from command /tmp/contents998689849/deps/0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lwwtrplp/xmlsec/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qwoda574-record/install-record.txt --single-version-externally-managed --compile:
              running install
              running build
              running build_ext
              *********************************************************************************
              Could not find xmlsec1 config. Are libxmlsec1-dev and pkg-config installed?
              *********************************************************************************

              ----------------------------------------
          Command "/tmp/contents998689849/deps/0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lwwtrplp/xmlsec/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qwoda574-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-lwwtrplp/xmlsec/
          pip install has failed. You have a vendor directory, it must contain all of your dependencies.
          **ERROR** Could not install pip packages: Couldn't run pip: exit status 1
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
   Exit status 223

我尝试手动上传适当的 libxmlsec1-dev 和 libxmlsec1 并设置一个环境变量来引用它们,但暂存过程似乎只是在设置软件包时忽略了这些。

我可以做些什么来让这个过程正常进行吗?我想在某个地方有一个自定义的 buildpack 可以解决问题,但我不确定是否有办法使用标准的 python buildpack 来代替。

【问题讨论】:

    标签: python linux python-3.x cloud-foundry


    【解决方案1】:

    主要选项是供应您的依赖项。使用此选项,您可以在本地构建,然后也推送所有已编译的位。诀窍是你必须在兼容的系统上构建,所以你需要一个 Ubuntu Trusty PC/VM/Docker 容器。

    按照这些说明操作,然后运行 ​​cf push 并确保您没有忽略 vendor 目录(如果存在,请从 .cfignore 中删除)。

    https://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring

    另一个应该起作用的选项是使用多构建包支持。有了这个,您可以使用两个构建包进行推送。第一个是Apt buildpack,第二个是python buildpack。 Apt buildpack 允许你安装你需要的包,看起来像libxmlsec1-dev。第二个只是标准的 Python buildpack,但它可以访问通过 Apt buildpack 安装的内容。

    您可以在此处查看说明:https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-09
      • 1970-01-01
      • 2016-10-05
      • 2018-08-25
      • 2023-03-19
      • 2021-02-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多