无法在 AWS EMR Notebook 中找到该文件

发布于 2025-01-09 11:29:37 字数 610 浏览 2 评论 0原文

我一直在尝试在 EMR Notebook 中使用一些 .txt.csv 文件,但找不到它们。

我正在尝试通过以下方式阅读:

with open('file.txt', 'r') as f:
    notes = f.read()

我尝试过的事情:

  • 使用 JupyterHub UI 上传了文件。我可以看到该文件,但无法从路径中读取它。我还使用 JupyterHub 终端检查了该文件。

  • 尝试从 s3 读取(很多人都以这种方式工作):

    with open('s3:///file.txt', 'r') as f:

  • < p>使用 hdfs dfshadoop 将文件复制到主节点(集群中)中的 hdfshadoop fs 。文件存在于两个目录中。

但是,我不知道如何访问 EMR Notebook 中的文件。

有什么想法吗?

I have been trying to use some .txt, .csv files in an EMR Notebook but I cannot locate them.

I am trying to read via:

with open('file.txt', 'r') as f:
    notes = f.read()

Things I tried:

  • Uploaded the file by using JupyterHub UI. I can see the file but I cant read it from the path. I also checked the file using JupyterHub terminal.

  • Tried to read from s3 (lots of people got it working in this way):

    with open('s3://<repo>/file.txt', 'r') as f:

  • Copied the file to hdfs and hadoop in master node (in cluster) using both: hdfs dfs and hadoop fs . File is present in both directories.

However, I have no clue how I can reach the file in EMR Notebook.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文