没有IDLE子进程连接
我刚开始学习Python编程,想在IDLE里编辑脚本,而不是在OSX的命令行中。不过,当我尝试启动IDLE时,出现了一个错误:“Idle子进程没有建立连接。要么IDLE无法启动子进程,要么个人防火墙软件阻止了连接。”我并没有设置防火墙,那这可能是什么问题呢?
2 个回答
2
你没有说明你使用的是哪个版本的Python或OS X,不过如果你是想用最近从python.org下载的64位Python 2.7的IDLE,那么你很可能遇到了一个已知问题。在这个问题报告中提到,在解决2.7安装程序的问题之前,最简单的解决办法是使用“10.3及以上”的安装程序来安装仅支持32位的2.7版本。
更新:这个问题出现在python.org的64位/32位Python 2.7安装程序中。后来的Python 2.7版本已经修复了这个问题;截至目前,Python 2.7.2是最新版本。不过,最初问题的根本原因是Apple在Mac OS X 10.6中提供的
2
你可以试着用“-n”这个选项来运行IDLE。关于这个选项的具体说明可以在IDLE的帮助文档里找到:
Running without a subprocess: If IDLE is started with the -n command line switch it will run in a single process and will not create the subprocess which runs the RPC Python execution server. This can be useful if Python cannot create the subprocess or the RPC socket interface on your platform. However, in this mode user code is not isolated from IDLE itself. Also, the environment is not restarted when Run/Run Module (F5) is selected. If your code has been modified, you must reload() the affected modules and re-import any specific items (e.g. from foo import baz) if the changes are to take effect. For these reasons, it is preferable to run IDLE with the default subprocess if at all possible.