python - TOR与Python(茎)挂在初始化
问题描述
我在 python 中使用 tor 时遇到了一些麻烦,我不太清楚从这里去哪里。
系统/软件包:Windows 10
Python 3.8(通过 jupyter 实验室)
干
tor(tor.exe 添加到 PATH)
我正在尝试运行以下代码:
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
)
它输出一行然后就坐
Oct 23 15:00:22.000 [notice] Bootstrapped 0% (starting): Starting
编辑 当我编辑出 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?
在运行之前,我确保没有运行 tor.exe 进程,并且我可以确认它确实在任务管理器中启动了一个 tor.exe 进程
我也试过杀死我的防火墙,但这没有任何区别。
关于如何进行/下一步的任何建议?我不知道下一步该尝试什么。
谢谢!
解决方案
问题是 [username]/appdata/roaming/tor 中的过时旧安装。我已经移动了安装 Tor 的目录,但不知道先清除该文件夹。一旦我删除它并重新安装 Tor 浏览器,一切都正常运行。
推荐阅读
- asp.net-core - 如何使用列表列表发布表单数据?
- html - 如何在底部为所有 3 个对齐的图像创建透明文本框叠加层
- python - 如何使用 Python2 中的“密码学”库从证书中打印公钥?
- mysql - 从 MySQL 运行 SELECT 时 JSON 长度的最大限制是多少
- android - 查找“不再支持 NdkCompile”的来源
- python - proc 与重量 python 等效的平均值
- php - 无法打开邮箱:远程规范无效
- c# - WPF Tabcontrol 具有用于 tabitems 的扩展器功能
- python - Prometheus - 在抓取之前覆盖具有不同标签的相同指标
- docker - 限制单个 GPU 上 tensorflow 的资源