简体   繁体   English

如何从运行 PySpark 内核的 EMR jupyter notebook 中的另一个 ipynb 文件导入?

[英]How to import from another ipynb file in EMR jupyter notebook which runs a PySpark kernel?

I'm using jupyter notebook on AWS EMR to run PySpark, and is having trouble importing modules from another file.我在 AWS EMR 上使用 jupyter notebook 运行 PySpark,但在从另一个文件导入模块时遇到问题。 I tried a couple methods that I searched on stackoverflow, none worked.我尝试了在 stackoverflow 上搜索的几种方法,但都没有奏效。 More specifically, I tried the following (here I have a notebook named "include.ipynb" in the same directory as the notebook that runs the import statements):更具体地说,我尝试了以下操作(这里我有一个名为“include.ipynb”的笔记本,与运行导入语句的笔记本位于同一目录中):

在此处输入图片说明

Both of these methods worked in jupyter notebook on my local computer.这两种方法都适用于我本地计算机上的 jupyter notebook。 Why aren't they working on AWS?他们为什么不在 AWS 上工作?

You have to install these packages in your EMR explicitly using Pip or conda.您必须使用 Pip 或 conda 在 EMR 中明确安装这些软件包。 Your local has those packages installed already.您的本地已经安装了这些软件包。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Jupyter Notebook 上的 other.ipynb 导入变量? - How to import variables from other .ipynb on Jupyter Notebook? 如何在 jupyter notebook 中将一个 ipynb 文件中定义的变量访问到另一个文件中? - How to access variables defined in one ipynb file into another in jupyter notebook? 如何从 Jupyter 笔记本上的 * .IPYNB 文件执行 * .PY 文件? - How to execute a * .PY file from a * .IPYNB file on the Jupyter notebook? 如何直接从终端创建和打开 jupyter notebook ipynb 文件 - How to create and open a jupyter notebook ipynb file directly from terminal 如何从.ipynb(Jupyter Notebook)制作可执行的Python文件? - How to make executable Python file from .ipynb (Jupyter Notebook)? vscode:如何自动缩进jupyter notebook ipynb文件? - vscode: how to autoindent jupyter notebook ipynb file? 如何从终端运行 an.ipynb Jupyter Notebook? - How to run an .ipynb Jupyter Notebook from terminal? 如何在不将其转换为 csv 的情况下将 PySpark dataframe 从一台 Jupyter 笔记本导入到另一台笔记本? - How to import a PySpark dataframe from one Jupyter Notebook to another without converting it to csv? 如何将 jupyter notebook 导入另一个 jupyter notebook? - How to import jupyter notebook to another jupyter notebook? Jupyter Notebook:导入.ipynb文件,并在其他.ipynb文件中访问它的方法,给出错误 - Jupyter Notebook: Import .ipynb file and access it's method in other .ipynb file giving error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM