如何在 Google Cloud 中的 Jupyter Notebook 服务上安装 Kaggle

迈克尔

我已经使用 Google Colab 来计算我的 Kaggle 比赛,现在我决定看看它是否可以使用 Google Cloud 上的服务更快地工作。我有一个*.ipybn来自 Google Cloud文件,已下载并尝试将其上传到 Google Cloud 实例。

我使用以下链接在 Google Colab 上创建了所有连接:https ://towardsdatascience.com/setting-up-kaggle-in-google-colab-ebb281b61463并且运行良好。

使用本教程:https : //towardsdatascience.com/how-to-use-jupyter-on-a-google-cloud-vm-5ba1b473f4c2 我为 Jupyter notebook 启动了一个新实例。上传了一个*ipybn文件,我尝试安装 Kaggle 并运行我的笔记本,但我通常会出现以下错误:

kaggle: command not found error ensure that your python binaries are on your path

如何将所有内容设置为在 Google Cloud 服务上运行?

迈克尔

使用第一个教程注意将根目录路径从 更改content/home/jupyter/,例如:

import zipfile
zip_ref = zipfile.ZipFile("/home/jupyter/Airbus_competition/input/test_v2.zip", 'r')
zip_ref.extractall("/home/jupyter/Airbus_competition/input/test_v2")
zip_ref.close()

有关安装kaggle的问题,您不必访问来自Jupyter笔记本根文件夹,但您可以安装并使用Kaggle API,当你从改变命令!kaggle!~/.local/bin/kaggle,例如(从教程命令改变为工作GCS):

!mkdir ~/.kaggle


import json
token = {"your_TOKEN"}
with open('/home/jupyter/.kaggle/kaggle.json', 'w') as file:
    json.dump(token, file)!cp /home/jupyter/.kaggle/kaggle.json 


~/.kaggle/kaggle.json


!~/.local/bin/kaggle config set -n path -v{home/jupyter/Airbus_competition}


!chmod 600 /home/jupyter/.kaggle/kaggle.json


!~/.local/bin/kaggle competitions download -c airbus-ship-detection -p /home/jupyter/Airbus_competition/input --force

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在Android设备上安装Jupyter Notebook?

如何在Jupyter Notebook中显示文件中的图像?

如何在Windows上运行的Jupyter Notebook中更改内核名称?

Jupyter Notebook中的Google-oauth

在JupyterLab中安装Jupyter Notebook扩展?

如何在气流中运行Jupyter Notebook

Python-如何在Jupyter Notebook中安装pyvttbl

在Google Cloud上的Docker映像中运行Jupyter Notebook

如何配置VM以通过Web访问Google Cloud Platform上的jupyter Notebook?

如何将数据从Google Cloud加载到Jupyter Notebook VM?

如何在Jupyter Notebook的输出中显示整个表格

在VSCode中编辑Google Colab Jupyter Notebook

如何在Kaggle Notebook中的GPU上运行Tensorflow的Keras model.fit()函数?

如何在Jupyter Python Notebook中的gmap上显示文本?

无法在Google Cloud Platform中创建Jupyter Notebook实例

如何使用Google Colab在Jupyter Notebook中显示GIF?

如何在IBM Data Science Experience上的Jupyter Notebook中启用SQL Magics?

从 Jupyter notebook (Google Cloud Datalab) 内部创建的文件位于何处?

Google Cloud 上的 Jupyter Docker

如何将 Kaggle 数据集导入 Google Cloud Platform

如何在 Google Colab 中的笔记本中显示图像(如在 Anacondan Jupyter Notebook 中)?

如何在 Microsoft Azure 的 Jupyter Notebook 中从 Kaggle 读取文件?

您可以在我的 GCP VM 上使用 Jupyter notebook 在 Google Cloud 中运行 TPU 训练吗?

如何在 Kaggle Notebook 上安装“Tree Ensemble Layer”

如何在 Windows 10 上安装 Jupyter Lab/Notebook?

如何在 jupyter notebook 上的 vscode 上运行 kaggle 数据集?

在 jupyter notebook 中安装 pylift

如何在 Jupyter Notebook 上安装 playwright?

如何在 Jupyter Notebook 中安装 Plotly