Python 错误 - IDLE 的子进程没有建立连接。IDLE 无法启动或个人防火墙软件阻止连接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29567051/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 04:43:54  来源:igfitidea点击:

Python error - IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection

pythonuser-interfaceruntime-errorsubprocesspython-idle

提问by Usce

I am new to programming and i decided to learn Python first, so;

我是编程新手,我决定先学习 Python,所以;

I installed Python, latest version 3.4. and I am trying to open Python IDLE(GUI) mode, so when I open I get message "IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.".

我安装了 Python,最新版本 3.4。并且我正在尝试打开 Python IDLE(GUI) 模式,所以当我打开时,我收到消息“IDLE 的子进程没有建立连接。IDLE 无法启动或个人防火墙软件正在阻止连接。”。

My firewall is not problem beacuse I put Python throught it. I also tried to reinstall it and it didnt made diffirence. So please if somenone can help!

我的防火墙没有问题,因为我将 Python 通过它。我也尝试重新安装它并没有产生差异。所以请如果有人可以提供帮助!

Thank you on your time :D

谢谢你的时间:D

采纳答案by Igor Tischenko

Delete all newely created .py files in the directory with Python. for example random.py, end.py - that was my problem that caused the same notification window. Reason in filename conflicts.

使用 Python 删除目录中所有新创建的 .py 文件。例如 random.py, end.py - 这是我的问题导致相同的通知窗口。文件名冲突的原因。

回答by Serge Ballesta

It may be a common problem that happens when you have in you current directory a file with same name on one from Python (references : Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection)

当您在当前目录中有一个来自 Python 的同名文件时,这可能是一个常见问题(参考:无法通过 IDLE 从资源管理器 [2013] 运行 Python - IDLE 的子进程没有建立连接

It seems it can also happen if you have incorrect environment variables such as HOMEPATHUSERPROFILE(references : Issue 14576: IDLE: inconsistent use of HOMEDRIVE, HOMEPATH, and USERPROFILE on Windows)

如果您的环境变量不正确,似乎也会发生这种情况,例如HOMEPATHUSERPROFILE(参考:问题 14576:空闲:Windows 上 HOMEDRIVE、HOMEPATH 和 USERPROFILE 的使用不一致

I've found another related question : Python IDLE subprocess error?

我发现了另一个相关问题:Python IDLE 子进程错误?

My advice if the answer is not there : google may be your friend ! The 3 clues above come from there :-)

如果答案不存在,我的建议是:谷歌可能是你的朋友!上面的3条线索来自那里:-)

回答by Karo Kuokkanen

I had a similar problem with a file called "test.py" and Python 2.7.9 - renaming the file to something else solved my issue. After checking, I noticed that there is a file with the same name under the Python27\Lib folder.

我在一个名为“test.py”和 Python 2.7.9 的文件中遇到了类似的问题 - 将文件重命名为其他内容解决了我的问题。检查后发现Python27\Lib文件夹下有一个同名文件。

Seems to be a bug in IDLE.

似乎是 IDLE 中的一个错误。

回答by CDS

Just had the same issue. So uninstalled and reinstalled which fixed it and took 10 minutes. The key with Windows machines is delete the old directory (C:\Python27\ because windows does seem to actually delete things) and when reinstalling specify a new directory (C:\Python279\ or whatever you choose to call it).

刚刚有同样的问题。所以卸载并重新安装它修复了它并花了10分钟。Windows 机器的关键是删除旧目录(C:\Python27\ 因为 Windows 似乎确实删除了东西)并在重新安装时指定一个新目录(C:\Python279\ 或您选择的任何名称)。

I am using Win 10 with Python 2.7.9.

我正在使用带有 Python 2.7.9 的 Win 10。

回答by WinMacLinUser

I fixed it, I needed to run IDLE with admin privileges. (I am using Windows 7 x64). Hope this helps.

我修复了它,我需要以管理员权限运行 IDLE。(我使用的是 Windows 7 x64)。希望这可以帮助。

回答by Fish

Go to C:/Users/[your user]/AppData/Local/Programs/Python/Python35-32 and delete or rename every *.py file in this directory which is named after a certain method, function, module or library. Then run IDLE. Should work.

转到 C:/Users/[your user]/AppData/Local/Programs/Python/Python35-32 并删除或重命名此目录中以特定方法、函数、模块或库命名的每个 *.py 文件。然后运行空闲。应该管用。

Hope I could help

希望我能帮上忙

回答by Sujatha

Simple...rename your .py file with some name different from any keyword name like 'random.py' which already exists in python package.

简单...重命名您的 .py 文件,其名称不同于任何关键字名称,例如 python 包中已存在的“random.py”。

Eg. I named one file as "random.py". The same error popped up. I renamed it to "random_demo.py". It worked. The different naming discards the problem of ambiguity between an already existing file and a newly created file with same name.

例如。我将一个文件命名为“random.py”。弹出同样的错误。我将其重命名为“random_demo.py”。有效。不同的命名解决了已经存在的文件和新创建的同名文件之间的歧义问题。

回答by Lakshmi Narayanan

The fix is here.

解决方法在这里

Open task manager, kill pythonw.exe, if you find 2 instances or more. Should work after that.

打开任务管理器,杀死 pythonw.exe,如果发现 2 个或更多实例。应该在那之后工作。

回答by amonroejj

For me: The drive pointed to by HOMEDRIVE was not writeable. I checked this by running idle the hard way, explicitly using python.exe rather than pythonw.exe:

对我来说:HOMEDRIVE 指向的驱动器不可写。我通过运行 idle 来检查这一点,明确使用 python.exe 而不是 pythonw.exe:

C:\coding\xyz>"C:\Python27\Lib\idlelib\..\..\python.exe"  
"C:\Python27\Lib\idlelib\idle.pyw"

 Warning: unable to create user config directory
P:\.idlerc
 Check path and permissions.
 Exiting!

回答by Eric

My problem was that the .py file wasn't on my local machine. It was on a shared directory.

我的问题是 .py 文件不在我的本地机器上。它位于共享目录中。

After moving the file to my local machine, I quit getting the error.

将文件移动到我的本地机器后,我不再收到错误消息。