1

在尝试运行 Stem's To Russia With Love 示例时,我收到以下错误:

~$ python practice.py

Starting Tor:

Traceback (most recent call last):
  File "practice.py", line 49, in <module>
    init_msg_handler = print_bootstrap_lines,
  File "/usr/local/lib/python2.7/dist-packages/stem/process.py", line 266, in launch_tor_with_config
    return launch_tor(tor_cmd, args, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership)
  File "/usr/local/lib/python2.7/dist-packages/stem/process.py", line 143, in launch_tor
    raise OSError('Process terminated: %s' % last_problem)
OSError: Process terminated: Timed out

我最初得到的是在这里解决的路径错误。我尝试重新启动 Ubuntu 实例(我在 VirtualBox 中运行 Ubuntu 14.04),以防万一其他运行的 tor 发生冲突但它给出了相同的错误。有人可以帮忙吗?

编辑:如果以任何方式连接,我的 torrc 文件现在似乎也是空的。

4

1 回答 1

2

它可能会失败,因为您缺少使用来自特定国家/地区的出口节点所需的 GeoIP 数据库。

尝试'ExitNodes': '{ru}',从 python 脚本中删除该行,或者由于您使用的是 Ubuntu,请尝试sudo apt-get install tor-geoipdb查看这是否有助于建立和运行连接。

由于构建电路需要时间,您也可以尝试稍微增加超时时间(尽管这可能不是它失败的原因)。

tor_process = stem.process.launch_tor_with_config(
  #tor_cmd = '/usr/bin/tor',
  timeout = 300,
  config = {
    'SocksPort': str(SOCKS_PORT),
#    'ExitNodes': '{ru}',
    'DataDir': '/tmp/tor',
    'Log': [
        'NOTICE file /tmp/tor.notice.log',
        'ERR file /tmp/tor.log',
    ],
  },
  init_msg_handler = print_bootstrap_lines,
)
于 2016-02-23T20:45:56.103 回答