jupyter保存路径
时间: 2023-08-24 16:08:29 浏览: 193
在 Jupyter Notebook 中保存文件时,默认的保存路径是当前运行 Jupyter Notebook 的文件夹。你可以通过以下步骤更改保存路径:
1. 打开 Jupyter Notebook。
2. 在 Jupyter Notebook 主页中,点击右上角的 "New",然后选择 "Notebook"。
3. 在新建的 Notebook 中运行以下代码,以更改保存路径为指定的文件夹路径:
```python
import os
# 设置保存路径为指定文件夹路径
os.chdir('/path/to/your/folder')
```
请确保将 `/path/to/your/folder` 替换为你想要设置的文件夹路径。
之后,新创建的 Notebook 将在指定的文件夹中保存。如果你希望更改所有 Notebook 的默认保存路径,可以修改 Jupyter Notebook 的配置文件。你可以使用以下命令打开配置文件:
```bash
jupyter notebook --generate-config
```
然后,找到配置文件 `jupyter_notebook_config.py` 并打开它,在文件中搜索 `c.NotebookApp.notebook_dir`,取消注释并将路径更改为你想要的默认保存路径。保存配置文件后,重启 Jupyter Notebook 以使更改生效。
希望这些信息对你有帮助!如果你有任何其他问题,请随时提问。
相关问题
jupyter notebook保存路径
Jupyter notebook 默认保存在用户目录下的 "Jupyter" 文件夹内。用户可以在打开 notebook 时选择其他保存路径,或者通过在命令行中运行 "jupyter notebook --notebook-dir=<directory>" 指令来更改默认保存路径。
jupyter改写路径
在Jupyter Notebook中,要改写默认路径,可以按照以下步骤操作:
1. 打开命令提示符或终端窗口。
2. 输入命令 `jupyter notebook --generate-config` 并按下回车键。这将在你的用户目录下生成一个名为 `jupyter_notebook_config.py` 的配置文件。
3. 使用文本编辑器打开 `jupyter_notebook_config.py` 文件。
4. 在文件中找到 `# c.NotebookApp.notebook_dir = ''` 这一行,并将其改为 `c.NotebookApp.notebook_dir = '你的新路径'`。将 `'你的新路径'` 替换为你想要设置的路径。
5. 保存修改后的配置文件。
6. 关闭命令提示符或终端窗口。
7. 重新启动Jupyter Notebook,你将会看到文件浏览器打开在你设置的新路径下。
阅读全文
相关推荐
















