以特定文件路径打开特定conda虚拟环境中的jupyter notebook

1.设置让每次打开jupyter notebook时,所打开的文件路径是固定的,后面如果需要在该环境中打开某文件,只需要将某文件复制到这个保存路径文件夹中即可。
1.找到Jupyter 配置文件,打开jupyter_notebook_config.py
1.存在jupyter_notebook_config.py

①Jupyter 配置文件通常位于用户主目录下的 .jupyter 文件夹中。具体路径如下:

1.Windows: C:\Users\<你的用户名>\.jupyter\jupyter_notebook_config.py

2.macOS/Linux: /home/<你的用户名>/.jupyter/jupyter_notebook_config.py

②使用命令查找配置文件是否存在

1.macOS/Linux:ls ~/.jupyter/jupyter_notebook_config.py

2.Windows(在命令提示符中):dir C:\Users\<你的用户名>\.jupyter\jupyter_notebook_config.py

2.未找到配置文件jupyter_notebook_config.py

1.使用命令jupyter notebook --generate-config生成配置文件

2.再根据所显示路径进入jupyter_notebook_config.py配置文件

2.修改配置文件(在文件中添加或修改)(保存后即可生效)
Windows

c.NotebookApp.notebook_dir = 'C:\\path\\to\\your\\directory'

macOS/Linux

c.NotebookApp.notebook_dir = '/path/to/your/directory'

2.不固定路径,但是需要在某个路径打开这个虚拟环境中的jupyter环境
1.激活虚拟环境
2.直接在特定路径打开jupyter notebook

①Windows

jupyter notebook --notebook-dir='C:\path\to\your\directory'

②macOS/Linux

jupyter notebook --notebook-dir='/path/to/your/directory'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值