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

梦想的初衷 提交于 2021-01-29 09:49:01

问题


I am using VS Code in Windows 10.
I am able to use the dependencies in my conda environment if I Run the Python Script in Terminal. However, I am not able to use the environment in the Python Interactive shell.

For instance, I am using my datascienceenvironment which has the package fuzzywuzzy. I have included the env path into the settings.jsonas the python.pythonPath. But the Python version used in the Jupyter Notebook is the default anaconda base 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.

What am I missing?

Thanks!


回答1:


I'm a developer on the Interactive Windows. Priyatham has already pointed you in the right direction. Currently our Window tries to use the currently selected environment (the one in the lower left corner). But we didn't want to totally block customers if they didn't have Jupyter installed in each environment. 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. If we find something with Jupyter we'll launch the Interactive Window using that. 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.



来源:https://stackoverflow.com/questions/56538270/vs-code-cant-load-anaconda-environment-on-python-interactive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!