python - IBM Bluemix 中的 Web 应用程序

标签 python ibm-cloud

我们想在 IBM Bluemix 中部署现有应用程序。我们使用 Python 命令提示符在 IBM Bluemix 中推送了应用程序,但是当我们在 IBM 中部署它时,它无法运行。它给出了以下错误:

Creating container Successfully created container Downloading app package... Downloaded app package (1.5K) Staging... Downloaded build artifacts cache (31.3M) None of the buildpacks detected a compatible application Exit status 222 Staging failed: Exited with status 222 Destroying container

FAILED Error restarting application: NoAppDetectedError TIP: Buildpacks are detected when the "cf push" is executed from within the directory that contains the app source code.

Use 'cf buildpacks' to see a list of supported buildpacks.

Use 'cf logs glucose_tracker_monitor --recent' for more in depth log information.

Finished: FAILED

这之后我不知道该怎么办。谁能帮我解决这些错误?

最佳答案

消息“没有任何 buildpack 检测到兼容的应用程序”意味着 Bluemix 中安装的 buildpack 都没有将您的项目识别为它们可以运行的项目。

来自 Python buildpack 的 Bluemix 文档,您的应用程序需要包含“setup.py”或“requirements.txt”文件,以使此 buildpack“检测”您的应用程序可以运行。

“requirements.txt”文件用于指定您的应用程序需要安装的任何 pip 包。有关示例,请参阅 requirements.txt “IBM-Bluemix”GitHub 存储库中“get-started-python”项目中的文件。

您的应用程序还应包含一个名为“Procfile”的文件,该文件将指定构建包应如何启动您的应用程序。

示例“Procfile”:

web: python hello.py

这会导致 buildpack 在启动应用程序时运行命令 python hello.py

关于python - IBM Bluemix 中的 Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42958740/

相关文章:

ibm-cloud - 如何训练 Watson session 服务?

ios - 适用于iOS模拟器的IBM-Bluemix Push Service构建失败

python - 如何使用 dateparser 解析 1000 年之前的日期?

python - __file__ 变量是什么意思/做什么?

条件生成器表达式返回 True 的 Python "all"函数。为什么?

java - 带有 JRE 7 的 Liberty 运行时

ibm-cloud - 在 Node-Red 中指定函数节点上的输出

java - 能否在 Java 中使用类似于关键字 args for python 的概念来最小化访问器方法的数量?

python - Heroku 应用程序在本地运行但出现 H12 超时错误(使用包)

javascript - NodeJS断言.AssertionError : How do I kill it?