【发布时间】:2016-04-18 01:00:39
【问题描述】:
当我在 Mac 上运行 python 应用程序时,它会显示许多关于希望“Python.app”接受传入网络连接的对话框。
即使我允许它多次,它也会一次又一次地显示。
如何让它一次不显示?
编辑
我发现了这个问题: Add Python to OS X Firewall Options?
我按照公认的答案去做,但最后当我运行codesign -s "My Signing Identity" -f $(which python) 时,它说:
/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
接下来怎么办?
【问题讨论】:
-
(Operation not allowed) 表示不允许您执行操作 - 具体而言,您不能在 /usr/bin 中创建文件,该文件实际上归 root 所有。由于您已经禁用了 SIP,您应该运行
codesign和sudo。
标签: python macos certificate firewall