简体   繁体   English

VS代码:无法在Python Interactive上加载anaconda环境

[英]VS Code: Can't load anaconda environment on Python Interactive

I am using VS Code in Windows 10. 我正在Windows 10中使用VS Code。
I am able to use the dependencies in my conda environment if I Run the Python Script in Terminal. 如果在Terminal中运行Python脚本,则可以在conda环境中使用依赖项。 However, I am not able to use the environment in the Python Interactive shell. 但是,我无法在Python Interactive Shell中使用该环境。

For instance, I am using my datascience environment which has the package fuzzywuzzy . 例如,我正在使用数据datascience环境fuzzywuzzy I have included the env path into the settings.json as the python.pythonPath . 我已经将env路径作为python.pythonPath包含在settings.json中。 But the Python version used in the Jupyter Notebook is the default anaconda base C:\\\\ProgramData\\\\Anaconda3\\\\python.exe 但是Jupyter Notebook中使用的Python版本是默认的蟒蛇基础C:\\\\ProgramData\\\\Anaconda3\\\\python.exe

在此处输入图片说明

What is also extrange, is that if I run !conda list within the Notebook, I can see the fuzzywuzzy package. 另外,如果我在Notebook中运行!conda list ,则可以看到fuzzywuzzy软件包。

What am I missing? 我想念什么?

Thanks! 谢谢!

I'm a developer on the Interactive Windows. 我是Interactive Windows上的开发人员。 Priyatham has already pointed you in the right direction. Priyatham已经为您指明了正确的方向。 Currently our Window tries to use the currently selected environment (the one in the lower left corner). 当前,我们的Window尝试使用当前选定的环境(左下角的一个)。 But we didn't want to totally block customers if they didn't have Jupyter installed in each environment. 但是,如果客户没有在每个环境中都安装Jupyter,我们就不会完全阻止他们。 So if the selected interpreter doesn't have Jupyter in the environment we'll check other environments on the system, looking for the closest python version match to the currently selected one. 因此,如果所选解释器的环境中没有Jupyter,我们将检查系统上的其他环境,寻找与当前所选工具最匹配的python版本。 If we find something with Jupyter we'll launch the Interactive Window using that. 如果我们使用Jupyter找到了一些东西,我们将使用它启动“交互窗口”。 In this case we do show a popup in the lower right indicating that we didn't find Jupyter and that we are falling back on a different environment, but this message can be pretty easy to miss. 在这种情况下,我们确实在右下方显示了一个弹出窗口,指示我们没有找到Jupyter,并且我们退回到了另一个环境,但是此消息很容易错过。

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

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