使用Vscode安装好Code runner之后,直接点击Run code会出现以下提示,显然是我没有把python装入环境,然时由于我使用的时conda的来管理各类虚拟环境,难道要我每次更换虚拟环境的时候都更换一次环境变量吗?python
'python' is not recognized as an internal or external command, operable program or batch file.
解决方案:
先在cmd里激活须要的虚拟环境,而后再使用cmd打开vscode,这样conda建立的环境变量也会传给vscode,就能够使用各类包的导入了。导入torch也不会心慌了~spa