如何在Bluemix中安装/导入依赖关系并执行Python文件 [英] How to install/import dependencies and execute a Python file in Bluemix
问题描述
我第一次使用IBM bluemix,并且有以下问题:
I am working with IBM bluemix for the first time, and have following questions::
1)当我们在本地桌面的python GUI中编写python程序时,我们总是通过pip安装所需的库,并将其导入我们的代码中.但是如何在Bluemix中做到这一点?
1) When we are writing a python program in python GUI our local desktop, we always install desired libraries through pip, and import them in our code. But how to do that in Bluemix?
import-from-python-library-on-bluemix 相似我的查询,但我不了解该过程.
import-from-python-library-on-bluemix is similar to my query, but I fail to understand the process.
2)如何在Bluemix上执行.py文件?
2) How to execute the .py file on Bluemix?
推荐答案
要在Bluemix中运行应用程序,您需要向您推送的源添加一些文件:
To run an app in Bluemix you need to add a few files to the source you push :
- requirements.txt:Python依赖项(它不是特定于Bluemix的,无论如何您都应该始终有一个,但在这里是必需的)
- Procfile:包含启动您的应用程序的命令
- manifest.yml:描述应用程序的基础架构/环境
- (可选)runtime.txt:精确指定要使用的python版本,如果省略,它将使用buildpack默认值
这篇关于如何在Bluemix中安装/导入依赖关系并执行Python文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!