亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Visual Studio Code 忽略 settings.json 字段

Visual Studio Code 忽略 settings.json 字段

偶然的你 2023-06-13 10:40:41
當選擇“運行代碼”(默認熱鍵)時,我似乎無法讓我的settings.json文件影響 python 在 VSCode 中的調用方式,我的用戶如下:Ctrl + Alt + Nsettings.json{    "python.pythonPath": "/usr/bin/python3",    "editor.suggestSelection": "first",    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",    "python.jediEnabled": true,    "editor.minimap.enabled": true,    "editor.multiCursorModifier": "ctrlCmd",    "workbench.tree.indent": 24,    "workbench.startupEditor": "untitled",    "workbench.settings.editor": "json",    "workbench.settings.openDefaultKeybindings": false,    "workbench.settings.openDefaultSettings": true,    "workbench.settings.useSplitJSON": false,       "explorer.confirmDragAndDrop": false,    "python.linting.enabled": true,    "python.languageServer": "Jedi",}然而,當我運行我的 python 文件而不是調試它時,它顯示:[Running] python -u "path/to/file.py"當我期待時(正如我設定的那樣python.pythonPath)settings.json:[Running] /usr/bin/python3 -u "path/to/file.py"為什么我的settings.json文件密鑰python.pythonPath對我的代碼的調用方式沒有影響?python在其他重要原因中,當我的代碼是用 python 3 編寫時,我的python 代碼甚至沒有在我的機器上運行,因為調用 python 2。VS代碼版本:Version: 1.47.3Commit: 91899dcef7b8110878ea59626991a18c8a6a1b3eDate: 2020-07-23T15:51:39.791Z (1 mo ago)Electron: 7.3.2Chrome: 78.0.3904.130Node.js: 12.8.1V8: 7.8.279.23-electron.0OS: Linux x64 4.15.0-112-generic
查看完整描述

1 回答

?
胡子哥哥

TA貢獻1825條經驗 獲得超6個贊

從vscode-python-DeprecatePythonPath中,python.pythonPath正在從所有 3 個范圍中刪除設置 -?User、workspace、workspace folder。工作區解釋器的路徑現在將存儲在 VS Code 的持久存儲中,而不是 settings.json 文件中。這就是為什么您的設置對代碼執行路徑沒有影響。您可以使用 Python 更改存儲在工作區設置中的值:選擇解釋器命令,或在用戶settings.json中添加設置:

"python.defaultInterpreterPath":


查看完整回答
反對 回復 2023-06-13
  • 1 回答
  • 0 關注
  • 286 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號