python - ConnectionRefusedError: [WinError 10061] 无法建立连接,因为目标机器在使用 Python 时在 VS Code 上主动拒绝了它
问题描述
当出现上述错误时,我正在编写一个简单的 python 程序。
以前在使用VS Code编写 python 程序时也发生过这种情况。仅VS Code有问题吗?
有人可以帮忙吗?
这是弹出的完整错误:
Traceback(最近一次调用最后一次):文件“C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py”,第 194 行,在run_module_as_main return run_code (代码,main_globals,无,文件“C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py”,第 87 行,run_code exec(code, run_globals) 文件“c:\Users \user.vscode\extensions\ms-python.python-2021.8.1105858891\pythonFiles\lib\python\debugpy\launcher_main .py”,第 97 行,在main
() 文件“c:\Users\user.vscode\extensions \ms-python.python-2021.8.1105858891\ pythonFiles \lib\python\debugpy\launcher_main.py”,第 53 行,在主 launcher.connect(host, port) 文件“c:\Users\user.vscode\extensions\ms-python.python-2021.8.1105858891\pythonFiles\lib\python\debugpy\launcher/ ../..\debugpy\launcher_init .py",第 34 行,在 connect sock.connect ((host, port)) ConnectionRefusedError: [WinError 10061] 无法建立连接,因为目标机器主动拒绝了它
解决方案
推荐阅读
- node.js - 带有共享包的打字稿项目设置
- reactjs - 通过 npm 安装 firebase 时遇到错误 | 解析时 JSON 输入意外结束
- javascript - 编码问题,无法使用 API 元素创建数组,Reactjs
- javascript - 在测试用例中得到一个未定义的值,但在生产中没有
- mongodb - Meteor 网站加载时间过长
- java - 使用 HttpURLConnection 在 Imgur 上抓取帖子
- c - 如何取消引用strlen中的空指针?
- vue.js - Laravel 数据绑定在 vue 模板上
- python - 如何绕过 selenium-webdriver 的机器人识别工具?
- javascript - 在 router.get 中使用类方法