Questions tagged «visual-studio-code»

1
如何使Visual Studio Code运行python 2.7.15
我正在使用具有High Sierra的iMac。我使用Anaconda安装了python 2.7.15和python 3.6.5。我为这两个都创建了虚拟环境。我正在尝试学习python,并且正在使用Visual Studio Code。我已经运行了针对python 3开发的脚本,但是我目前正在使用的代码针对python 2开发。我无法使VScode使用python 2解释器运行,无论我使用什么似乎都使用python 3做。我可以重写脚本以使其与python 3兼容,但我宁愿不这样做。我试过从python 2虚拟环境运行VScode,但这似乎没有效果。我在VScode中编辑了设置,并将变量python.pythonPath更改为指向python 2,但这是行不通的。我使用命令托盘来更改python解释器,但这没有 也不行。如何强制VScode运行python 2。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.