我在我的 Mac 上遇到了同样的问题。尝试将 tor 文件的确切位置指定给 tor_cmd 参数:
tor_process = stem.process.launch_tor_with_config(
tor_cmd = '/Applications/TorBrowser.app/Tor/tor.real',
config = { SocksPort': str(SOCKS_PORT),
'ExitNodes': '{ru}',},
init_msg_handler = print_bootstrap_lines,
)
/tor-browser_en-US/Browser/TorBrowser/Tor
文件夹中,但我不确定它是否是相同的文件,因为当我添加这个路径时,它会报错。你能帮忙吗? - QPTRtor_cmd
的正确路径是:/Applications/TorBrowser.app/Contents/MacOS/Tor/tor.real
。 - juancb