VS code 剛剛配置遠程調試時無法識別相對路徑,本文記錄解決方案。
VS code 剛剛配置好 remote ssh 遠程調試,python 代碼執行時不會進入工程目錄:
# /usr/bin/env /root/anaconda3/bin/python /root/.vscode-server/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/python/debugpy/launcher 35911 -- /workspace/nfs/datasets/VVD_Win_Share/Bearing/ng_faker/demo.py
python 插件設置中沒有設置
終端執行命令時使用文件的路徑代替現在打開的目錄
。
execute in file
:再次運行代碼時會進入當前工程目錄再執行程序
# cd /workspace/nfs/datasets/VVD_Win_Share/Bearing/ng_faker ; /usr/bin/env /root/anaconda3/bin/python /root/.vscode-server/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/python/debugpy/launcher 38703 -- /workspace/nfs/datasets/VVD_Win_Share/Bearing/ng_faker/demo.py