VSCode找不到python(Anaconda安装) [英] VSCode cannot find python (Anaconda install)

查看:785
本文介绍了VSCode找不到python(Anaconda安装)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Windows10上安装了带有vscode 1.27.2的anaconda3 5.2.0(实际上已删除并重新安装),并试图在终端上执行最简单的python代码.但是,出现以下错误...

I have just installed anaconda3 5.2.0 with vscode 1.27.2 on windows10 (actually, removed and reinstalled) and am trying to execute the simplest python code on terminal. However, I get the following errors...

jac @ p50:/mnt/c/Users/jac/Documents/dev/python/JupyterNotebooks/Learn/Pandas Learn $ activate base/mnt/c/Users/jac/Anaconda3/Scripts/activate:2:/mnt/c/Users/jac/Anaconda3/Scripts/activate:cygpath:找不到/mnt/c/Users/jac/Anaconda3/Scripts/activate:3:.:无法打开/etc/profile.d/conda.shjac @ p50:/mnt/c/Users/jac/Documents/dev/python/JupyterNotebooks/Learn/Pandas Learn $C:/Users/jac/Anaconda3/python.exe"c:/Users/jac/Documents/dev/python/JupyterNotebooks/Learn/Pandas Learn/hello1.py"-bash:C:/Users/jac/Anaconda3/python.exe:没有这样的文件或目录

jac@p50:/mnt/c/Users/jac/Documents/dev/python/JupyterNotebooks/Learn/Pandas Learn$activate base /mnt/c/Users/jac/Anaconda3/Scripts/activate: 2: /mnt/c/Users/jac/Anaconda3/Scripts/activate: cygpath: not found /mnt/c/Users/jac/Anaconda3/Scripts/activate: 3: .: Can't open /etc/profile.d/conda.sh jac@p50:/mnt/c/Users/jac/Documents/dev/python/JupyterNotebooks/Learn/Pandas Learn$ C:/Users/jac/Anaconda3/python.exe "c:/Users/jac/Documents/dev/python/JupyterNotebooks/Learn/Pandas Learn/hello1.py" -bash: C:/Users/jac/Anaconda3/python.exe: No such file or directory

我确实在C:/Users/jac/Anaconda3/python.exe看到了python.exe文件.我也不明白为什么在bash中使用终端.我已经使用cygwin并在win10机器中安装了ubuntu.我没有丰富的环境设置经验,但确实需要运行vscode进行调试,并且需要anaconda库(熊猫)才能完成一些工作.任何帮助真的很感激.谢谢,约翰

I do see the python.exe file at C:/Users/jac/Anaconda3/python.exe . I also do not understand why terminal in bash. I have used cygwin and installed ubuntu in my win10 machine. I don't have extensive env setup experience, but really need to get vscode running to debug and need anaconda libraries (pandas) to get some work done. Any help really appreciated. Thanks, John

推荐答案

好,所以问题是Anaconda + VSCode + WSL玩起来不好.我真的不必在WSL(bash.exe)下运行我的python程序,因此我将terminal> integrated> shell:windows值更改为C:\ WINDOWS \ System32 \ cmd.exe,并取消了Activate Environment选项.现在,我可以执行和调试了!:)

OK, so the problem is that Anaconda + VSCode + WSL not playing nice. I really don't have to run my python programs under WSL (bash.exe), so I changed the terminal>integrated>shell:windows value to C:\WINDOWS\System32\cmd.exe, and unticked the Activate environment option. Now I can execute and debug! :)

这篇关于VSCode找不到python(Anaconda安装)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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