简体   繁体   English

带有 Python(词干)的 TOR 挂在初始化上

[英]TOR with Python (stem) hanging on initialization

I'm having some trouble using tor with python and I don't quite know where to go from here.我在 python 中使用 tor 时遇到了一些问题,我不太知道从哪里开始。

System/packages: Windows 10系统/软件包:Windows 10

Python 3.8 (via jupyter lab) Python 3.8(通过 jupyter 实验室)

stem

tor (tor.exe added to PATH) tor(tor.exe 添加到 PATH)

I'm trying to run the following code:我正在尝试运行以下代码:

import stem

proxy_port = 9050
def print_bootstrap_lines(line):
  if "Bootstrapped " in line:
    print(line)

tor = stem.process.launch_tor_with_config(
  config = {
    'SocksPort': str(proxy_port) },
  init_msg_handler = print_bootstrap_lines, take_ownership=True
)

It outputs one line and then just sits它输出一行然后就坐

Oct 23 15:00:22.000 [notice] Bootstrapped 0% (starting): Starting

edit When I edit out the boostrap print line, I also get these warnings:编辑当我编辑掉 boostrap 打印行时,我也会收到这些警告:

[warn] Path for GeoIPFile (<default>) is relative and will resolve to D:\projects\Valuator\<default>. Is this what you wanted?
Oct 29 08:44:26.812 [warn] Path for GeoIPv6File (<default>) is relative and will resolve to D:\projects\Valuator\<default>. Is this what you wanted?

Before running I made sure there were no tor.exe processes going, and I can confirm that it does start a tor.exe process in the task manager在运行之前,我确保没有 tor.exe 进程在运行,并且我可以确认它确实在任务管理器中启动了一个 tor.exe 进程

I've also tried killing my firewall and that doesn't make any difference.我也试过杀死我的防火墙,但这没有任何区别。

Any suggestions of how to proceed/next steps?关于如何进行/下一步的任何建议? I'm at a loss for what to try next.我不知道接下来要尝试什么。

Thanks!谢谢!

The issue was an outdated old install in [username]/appdata/roaming/tor.问题是 [username]/appdata/roaming/tor 中过时的旧安装。 I had moved the directory I installed Tor to, but didn't know to clear that folder first.我已经将安装 Tor 的目录移动到了,但不知道先清除该文件夹。 Once I deleted that and reinstalled Tor browser, everything ran correctly.一旦我删除它并重新安装 Tor 浏览器,一切都运行正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM