我下載了 VSC,最近為了一門課程,我在 ubuntu 中打開了 jupyter notebook。現在,當我嘗試在 VSC 中運行我的程式時,它會一直在 chrome 中打開瀏覽器并顯示“無法訪問此站點:本地主機無法連接”。我看了一些網站,他們說要洗掉
"action": "openExternally",
"pattern": "^\\s*Now listening on:\\s (https?://\\S )"
},
從啟動:json 檔案。但是當我打開 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": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
有人可以幫我嗎?感謝您的時間
uj5u.com熱心網友回復:
只需擺脫(或注釋掉)這整個部分。
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
這是打開 chrome 的說明,因此如果您洗掉它,chrome 將不會在運行時打開。
添加以下設定以正常運行python -
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
有關更多詳細資訊,請查看launch.json config 上的 vs 代碼頁面。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/463137.html
標籤:python-3.x ubuntu 视觉工作室代码 jupyter-笔记本
上一篇:VS終端只輸出兩個目錄?
