简体   繁体   English

如何为 VSCode Jupyter 笔记本保存默认的 python env

[英]How to save a default python env for VSCode Jupyter Notebooks

I've started playing around with the new VSCode notebooks feature and I find one aspect of it particularly annoying.我已经开始使用新的 VSCode notebooks 功能,我发现它的一个方面特别烦人。

I open my "jupyter_notebooks" directory the same way I would when using a typical jupyter server, except I open it in VSCode.我打开“jupyter_notebooks”目录的方式与使用典型 jupyter 服务器时的方式相同,只是我在 VSCode 中打开它。 And I click on a script to bring it into the editor.然后我单击一个脚本将其放入编辑器中。

However, when I go to run my first cell, it asks me which python environment I want to run it in. This happens every time I start running any script... this is particularly annoying because the "suggested" environment isn't the one that I always use.但是,当我 go 运行我的第一个单元时,它会询问我要在哪个 python 环境中运行它。每次我开始运行任何脚本时都会发生这种情况......这特别烦人,因为“建议的”环境不是我经常使用的一个。

Is there a way to set the default python env to a vscode workspace or something so that when I open that folder in vscode it just assumes which env I want to use and stops asking me?有没有办法将默认的 python env 设置为 vscode 工作区或其他东西,以便当我在 vscode 中打开该文件夹时,它只是假设我想使用哪个环境并停止询问我?

This is an image of the menu that keeps popping up every time I want to run a new script.这是每次我想运行新脚本时不断弹出的菜单图像。

在此处输入图像描述

You can use "Ctrl+Shift+P" and choose "Python:Select Interpreter"您可以使用“Ctrl+Shift+P”并选择“Python:Select Interpreter”

在此处输入图像描述

Then reload window can work.然后重新加载window即可。

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

相关问题 如何在 jupyter 笔记本(VSCode + Python 扩展)中隐藏单元格 output? - How to hide cell output in jupyter notebooks (VSCode + Python Extension)? VSCODE JUPYTER - 如何在笔记本(.ipynb)中显示与 VSCode 的 python(.py)中相同的自动完成功能? - VSCODE JUPYTER - How to display SAME AUTOCOMPLETION in notebooks (.ipynb) as it is in python (.py) from VSCode? 无法在 VScode 中打开 Python:Select 解释器或 Jupyter 笔记本 - Cannot open Python:Select Interpreter nor Jupyter notebooks in VScode 来自 Jupyter Notebooks 的 Python 版本和环境的 VSCode 问题 - VSCode issue with Python versions and environments from Jupyter Notebooks VSCode 中的 Jupyter 笔记本未显示最新的 Python 内核列表 - Jupyter notebooks in VSCode not showing up to date python kernel list Pylance 在 VSCode Jupyter 笔记本中不起作用 - Pylance not working in VSCode Jupyter notebooks 如何将 VSCode 上的向下箭头设置为 go 到 Jupyter Notebooks 的行尾? - How to make down arrow on VSCode to go to end of line in Jupyter Notebooks? 如何!rm python_var(在Jupyter笔记本中) - How to !rm python_var (in Jupyter notebooks) 如何将ipython / jupyter设置为vscode的默认python终端? - How to set ipython/jupyter as the default python terminal for vscode? 如何在 Jupyter 中切换 python env - How to switch python env in Jupyter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM