I'm new to python programming, and want to try to edit scripts in IDLE instead of the OSX command line. However, when I try to start it, it gives me the error "Idle Subprocess didn't make a connection. Either Idle can't start a subprocess or personal firewall software is blocking the connection." I don't have a firewall configured, so what could the problem be?
问题:
回答1:
You can try running IDLE with the "-n" option. From the IDLE help:
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.
回答2:
You don't say which version of Python or OS X you are using but, if you are trying to use the IDLE installed by the recent python.org 64-bit installer for Python 2.7, you are almost certainly running into a known issue. As noted in the bug report, until the problem with the 2.7 installer is resolved, the simplest workaround for 2.7 is to install the 32-bit-only version of 2.7 using the '10.3 and up' installer.
UPDATE: This problem existed with the python.org 64-bit/32-bit installer for Python 2.7. It has been corrected with subsequent releases of Python 2.7; as of this writing, Python 2.7.2 is current. However, the root cause of the original problem remains the version of Tcl/Tk 8.5
supplied by Apple with Mac OS X 10.6. To use IDLE or Tkinter with the current 64-bit Python installers for OS X, you need to install the more stable Tcl/Tk 8.5
from ActiveState. Updated details are maintained here which is also linked from the current installer download pages.