执行Python文件遇到的问题 pip install 或者 curl 执行下载 安装命令时,出现ssl 安全通道错误.

1. pip install  error

  单次解决:  pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org

  永久解决  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12


参考资料:

https://stackoverflow.com/questions/41618766/powershell-invoke-webrequest-fails-with-ssl-tls-secure-channel

2. Open()打开文件. 文件格式

   

 with open('key.txt', encoding='utf-8', mode = 'r') as f:
        for line in f:
            line=line.strip('
').replace('ufeff','')
            //xxxxx

3. Visual Studio Code Tab键盘冲突

将以下内容添加到keybindings.json :

{"key": "tab", "command": "-acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible"},    
{"key": "tab", "command": "acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible && !inSnippetMode" },    

第一行禁用现有规则,第二行重新启用它,除非您处于片段模式。

原文地址:https://www.cnblogs.com/mailaidedt/p/12109140.html