如何获取在Pivotal

如何获取在Pivotal

本文介绍了如何获取在Pivotal Cloud Foundry上运行的python xmlsec库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使python模块python3-saml在使用标准python buildpack和cflinuxfs2堆栈的Cloud Foundry应用程序上工作.该模块依赖于python xmlsec模块作为依赖项,但不幸的是,我在使其正常工作时遇到了问题.

I'm in the process of trying to get the python module python3-saml working on a cloud foundry app that is using the standard python buildpack and cflinuxfs2 stack. This module relies on the python xmlsec module as a dependency, but I'm unfortunately running into issues with getting it working.

我整理了一个需求文件,并提供了所有的python依赖项,但是当我运行"cf push"命令时,仍然出现以下错误.

I've put together a requirements file and have vendored all of the python dependencies, but I keep getting the following error when I go to run the "cf push" command.

            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并设置环境变量以引用它们,但是在安装程序包时,暂存过程似乎只是忽略了它们.

I tried uploading the appropriate libxmlsec1-dev and libxmlsec1 manually and set an environment variable to refer to them, but the staging process appears to just ignore those while it's setting up packages.

有什么我可以做的才能使此过程正常进行吗?我以为那里有个自定义的buildpack可以解决这个问题,但是我不确定是否有办法使用标准的python buildpack来完成.

Is there anything that I could do to get this process working? I'd imagine there's a custom buildpack out there somewhere that would do the trick, but I wasn't sure if there was a way to do this using the standard python buildpack instead.

推荐答案

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

The primary option would be to vendor your dependencies. With this option, you build locally and then push all the compiled bits too. The trick is that you have to build on a compatible system, so you need an Ubuntu Trusty PC/VM/Docker container.

遵循这些说明,然后运行 cf push &确保您没有忽略 vendor 目录(如果存在,请从 .cfignore 删除).

Follow these instructions, then run cf push & make sure that you do not have the vendor directory ignored (remove from .cfignore, if it exists).

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

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

The other option that should work is to use multi-buildpack support. With this you can push using two buildpacks. The first would be the Apt buildpack and the second would be the python buildpack. The Apt buildpack allows you to install the packages that you need, which looks like libxmlsec1-dev. The second is just the standard Python buildpack, but it will have access to what has been installed via the Apt buildpack.

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

You can see instructions here: https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html

这篇关于如何获取在Pivotal Cloud Foundry上运行的python xmlsec库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 03:03