VSCode cannot find python (Anaconda install)

爱⌒轻易说出口 提交于 2021-02-08 05:24:13

问题


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: 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

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


回答1:


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! :)



来源:https://stackoverflow.com/questions/52583127/vscode-cannot-find-python-anaconda-install

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