vscode 设置运行程序的python版本
2020-06-02 本文已影响0人
恶魔缘
0x00 说明
笔者mac上装了python2 和 python3,虽然选择了解释器为python3,每次点击运行vscode总是以python2运行。

只好每次在命令中,手动执行,比较不方便。 网上的解决方法都不好使,偶然发现一篇博客博客讲到的方法,可以解决我的问题,马上记录一下。
0x01 配置code runner
笔者知道肯定是修改某个配置文件,原来是code runner。
设置中,搜索 code-runner:Executor Map,点击在setting.json中编辑

添加如下代码即可

0x02 指定默认python版本
每次打开.py文件,vscode总会提示没有选择python解释器,修改如下配置即可
