在Apache Zeppelin上运行独立的python脚本 [英] Run standalone python script on Apache Zeppelin

查看:120
本文介绍了在Apache Zeppelin上运行独立的python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用

由于它支持Shell解释器%sh ,因此我仅使用它来运行带有参数的独立python脚本.

 %shpython评估.py gold.csv pred.csv 

如果不确定输入文件和脚本的位置,则可以在Zeppelin段落中运行Shell命令 pwd 来查找它们.

 %sh密码 

I have been using Apache Zeppelin Notebook for running Scala codes. Now a standalone Python script needs to be run on the same notebook. Scala codes produce some CSV files in the precedding paragraphs which should be passed as arguments to the Python script. What's the easiset way to run the Python script from another paragraph of the same Zeppelin notebook?

解决方案

Zeppelin provides several interpreters which can be binded to a respective notebook. Click on the Interpreter Binding option on the top right side of your notebook to see what's supported by your notebook.

Since it supports the Shell interpreter %sh, I simply use this to run the standalone python script with arguments.

%sh
python evaluate.py gold.csv pred.csv 

If you are not sure about the location of the input file and scripts, you can run the Shell command pwd in a Zeppelin paragraph to find them.

%sh
pwd

这篇关于在Apache Zeppelin上运行独立的python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆