VSCode 代码训练相关环境配置

安装插件

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

解决方案:

  1. 选择 View -> Command Palette.
  2. 输入 remote
  3. 输入 Remote-SSH: Kill VS Code Server on Host…
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值