在 VsCode 中激活 Anaconda 环境 [英] Activating Anaconda Environment in VsCode

查看:110
本文介绍了在 VsCode 中激活 Anaconda 环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Anaconda 在我的系统上运行,VsCode 也在运行,但是如何在运行我的 python 脚本时让 VsCode 激活特定环境?

I have Anaconda working on my system and VsCode working, but how do I get VsCode to activate a specific environment when running my python script?

推荐答案

如果 Anaconda 是您的默认 Python 安装,那么它只在您安装 Microsoft Python 扩展.

If Anaconda is your default Python install then it just works if you install the Microsoft Python extension.

无论使用何种 Python 编辑器或您是否需要指向特定安装,以下内容都应该可以工作:

The following should work regardless of Python editor or if you need to point to a specific install:

在 settings.json 中用类似的东西编辑 python.path

In settings.json edit python.path with something like

"python.pythonPath": "C:\Anaconda3\envs\py34\python.exe"

说明编辑 settings.json

Instructions to edit settings.json

这篇关于在 VsCode 中激活 Anaconda 环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆