已经安装好了多个版本python,其中某个版本有pyqt
指定python版本路径:
https://code.visualstudio.com/docs/python/environments#_environment-variable-definitions-file
File (Code on macOS) > Preferences > Settings menu command (Ctrl+,)
右上角:
编辑settings.json :
{
"python.pythonPath": "c:/Python27/python.exe"
}
设置编译环境:
Debug > (Open /Add) Configuration
编辑launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"pythonPath": "${config:python.pythonPath}",
"env": {"PYTHONPATH":"${workspaceRoot}"},
"module": "pyqt"
}
]
}
https://www.jianshu.com/p/4e5aaf317f95