平时遇到一些bug记录一下
1. 远程ssh vscode连接报错
[14:16:55.695] Install terminal quit with output: 过程试图写入的管道不存在。
[14:16:55.695] Received install output: 过程试图写入的管道不存在。
[14:16:55.696] Failed to parse remote port from server output
[14:16:55.697] Resolver error: Error:
at Function.Create (c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:64659)
at Object.t.handleInstallOutput (c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:63302)
at Object.t.tryInstall (c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:415135)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:294918
at async Object.t.withShowDetailsEvent (c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:406463)
at async Object.t.resolve (c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:1:295994)
at async c:\Users\lxy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.7\out\extension.js:127:110656
[14:16:55.702] ------
问题原因:因为在windows上VSCode使用的默认ssh工具存在实现上的问题 ,导致一旦我们直接使用默认ssh连接会有报错:”过程试图写入的管道不存在”(The process tried to write to a nonexistent pipe)。
解决:
- 方法1:删除默认ssh环境变量配置
%SYSTEMROOT%\System32\OpenSSH\ - 方法2:删除服务上的vscode配置
- 方法3:如果是出现‘Download wget’的信息,则需要服务器连上网
2. 解决git远程推送分支每次都要输入账号密码
如果不想每次都输入账号密码,则可修改根目录下的.gitconfig文件里面的配置,如下图:
3. 无法导入本地自定义的python包
AttributeError: module 'utils.Config' has no attribute 'setup_seed'
原因:没有实例化类
解决方法:
-
- 用静态方法
-
- 实例化类的对象,然后去调用函数
如下图是用静态方法解决该问题:
4. 报错:too many values to unpack
原因:返回的参数是四个,但是只用了少于4的参数去接收