简体   繁体   English

在Visual Studio Code中使用多个Python内核

[英]Using multiple Python kernels in Visual Studio Code

I am trying to start using Visual Studio Code with Python/Jupyter extensions by Don Jayamanne. 我正在尝试开始使用Don Jayamanne的带有Python / Jupyter扩展的Visual Studio Code。 I have both Python 3.5 and 3.6 kernels on my system, but I am unable to make them both visible to those extensions. 我的系统上同时拥有Python 3.5和3.6内核,但无法使这些扩展都可见。 Only the system default kernel is available in VS Code. VS Code中仅提供系统默认内核。

How to make sure VS Code and Python extensions see all available Python kernels and allow me to choose from them? 如何确保VS Code和Python扩展看到所有可用的Python内核并允许我从中选择?

I got it. 我知道了。 Ctrl + Shift + P (Command palette) -> Python: Select Workspace interpreter Ctrl + Shift + P (命令选项板)-> Python:选择工作区解释器

I am using Microsoft's Python extension. 我正在使用Microsoft的Python扩展。 For this, you can do: 为此,您可以执行以下操作:

Ctrl + Shift + P (Command palette) -> Python: Select Interpreter Ctrl + Shift + P (命令面板)-> Python: Select Interpreter

OR, click on the environment on the bottom left corner (eg below), and change it. 或者,单击左下角(例如,下面)的环境,然后进行更改。

在此处输入图片说明

If it is still not discoverable, then we need to include the relevant paths. 如果仍然找不到它,那么我们需要包括相关路径。 You can do so via the Command Palette -> Preferences: Open User Settings -> Search for path -> Select the Python extension to change its settings -> Point the paths to your system setup accordingly (eg Conda Path , Pipenv Path , Python Path , Venv Path ) 您可以通过Command Palette -> Preferences: Open User Settings ->搜索path ->选择Python扩展名以更改其设置->相应地将路径指向您的系统设置(例如Conda PathPipenv PathPython PathVenv Path

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM