When I run a python application on Mac, it shows many dialogs about want "Python.app" to accept incoming network connections.
Even I Allow it many times, it shows again and again.
How to allow it one time and not show any more?
I found this question: Add Python to OS X Firewall Options?
I followed the accepted answer to do but finally when I run codesign -s "My Signing Identity" -f $(which python)
, it said:
/usr/bin/python: replacing existing signature
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: can't create output file: /usr/bin/python.cstemp (Operation not permitted)
/usr/bin/python: the codesign_allocate helper tool cannot be found or used
How to do next?
Apparently El Capitan has something call System Integrity Protection that prevents any user (even root) to modify certain OS resources. Such as the /usr/bin directory in this case, where you have the python executable. To self sign the python binary you can disable SIP by rebooting your mac in recovery mode (reboot while holding CMD+R) and then typing this in the terminal:
csrutil disable
then boot back into regular OSX, and follow the steps to self sign python and execute:
codesign -s "My Signing Identity" -f $(which python)
and finally reboot back into Recovery Mode, and re-enable SIP:
csrutil enable