我可以从Jupyter笔记本使用Dataflow for Python SDK吗? [英] Can I use Dataflow for Python SDK from a Jupyter notebook?
问题描述
我想从Jupyter笔记本上玩 Python SDK的数据流.我不确定需要什么依赖关系,以及我是否可以将代码分散到多个笔记本单元中.涉及哪些步骤?
I want to play with Dataflow for Python SDK from a Jupyter notebook. I am not sure what are the dependencies needed and if I can spread the code over multiple notebook cells or not. What are the steps involved?
推荐答案
是的!没有特别的步骤.例如,使用Conda环境(建议使用IPython/Jupyter笔记本),启动Jupyter笔记本的命令为:
Yes! There are no special steps involved. For example, using a Conda environment (recommended for using IPython/Jupyter notebooks) the commands to start a Jupyter notebook are:
- conda create -n TESTENV jupyter
- 源激活TESTENV
- 通过pip install https://github.com/GoogleCloudPlatform/DataflowPythonSDK/存档/v0.2.3.tar.gz
- jupyter笔记本
- conda create -n TESTENV jupyter
- source activate TESTENV
- pip install https://github.com/GoogleCloudPlatform/DataflowPythonSDK/archive/v0.2.3.tar.gz
- jupyter notebook
以上命令安装了Python Dataflow v0.2.3版本.请将其更改为所需的版本.在第一个笔记本单元格中,执行以下导入语句:
The commands above install version v0.2.3 of Python Dataflow. Please change it to the version desired. In the first notebook cell execute the following import statement:
将google.cloud.dataflow导入为df
import google.cloud.dataflow as df
现在您已经准备就绪.您可以将工作流代码分布在多个单元格上.请查看以下描述非常简单的工作流程的笔记本: https://github.com. com/silviulica/WorkflowExamples/blob/master/notebooks/HelloWorld.ipynb
Now you are all set. You can spread the workflow code over multiple cells. Check out the following notebook describing a very simple workflow: https://github.com/silviulica/WorkflowExamples/blob/master/notebooks/HelloWorld.ipynb
这篇关于我可以从Jupyter笔记本使用Dataflow for Python SDK吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!