安装插件
VSCode安装相关插件
ctrl+shift+x
秘钥配置
windows秘钥生成
秘钥拷贝
将windows id_rsa.pub下的内容copy到 /home/user/.ssh/authorized_keys
ssh 配置
点击到这里可以进行ssh的配置
mac 相关配置
mac 配置debug环境
在settings.json 中加入下述操作
{
"python.testing.nosetestArgs": [
"Code"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": true,
"RunInTerminal": {},
"python.pythonPath": "/Applications/anaconda3/envs/targetdection1/bin/python"
}
如果没有settings文件夹,可以考虑直接新建一个文件夹,注意"python.testing.nosetestArgs": [
“Code”
],的设置
参考下述链接找到
https://blog.csdn.net/qq_37453155/article/details/124956479
Windows
配置python环境
ctrl+shift+p 然后输入
可以进行编译器的选择
配置ssh链接环境
免密登录
https://blog.csdn.net/Answer3664/article/details/110453185
Debug
launch.json的配置
这个文件可以在.vscode中新建
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "/home/ztw/GAT", #dubug调试路径,加入main.py文件
"console": "integratedTerminal",
"cwd": "${fileDirname}", #找不到文件可以修改这个路径
}]
}
报错
ImportError: can't find '__main__' module in '/home/ztw/GAT'
在launch.json后面指定对应的.py文件
debug运行时的环境调试
ctrl+shift+p选择python的调试环境。在launch.json后面指定对应的.py文件
选择python解释器
ctrl+shift+p 选择python解释器
插件安装
安装markdown编辑器
运行
运行时,如果出现文件未发现,需要在终端切换到指定的目录下,然后再右击选择再终端中运行。
报错
报错信息:
The remote host may not meet VS Code Server's prerequisites for glib and libstdc++
原因是服务器home目录没有足够的空间,此时自动补全功能也是显示不了的
背景颜色
ProxyCommand配置登录
Host myhost
User username
ProxyCommand nc -X connect -x sshproxy.xxx.xxx.xx.xx:12345 %h %p
Hostname target_ip_address
对应问题资料
https://blog.csdn.net/weixin_38842968/article/details/117327150
报错信息
vscode could not establish connection to linux The VS Code Server failed to start
解决方案:
- 选择 View -> Command Palette.
- 输入 remote
- 输入 Remote-SSH: Kill VS Code Server on Host…