Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我用pip安装后,运行都会卡住在回调这里 #7

Open
347377260 opened this issue Mar 26, 2024 · 13 comments
Open

为什么我用pip安装后,运行都会卡住在回调这里 #7

347377260 opened this issue Mar 26, 2024 · 13 comments

Comments

@347377260
Copy link

微信截图_20240326113037
卡在这里,换过系统 换过微信版本 都不行 ,是不是缺少什么东西?求大佬指教
代码如下
Uploading 微信截图_20240326114553.png…

@347377260
Copy link
Author

import os
import json
import time
from wechat_ocr.ocr_manager import OcrManager, OCR_MAX_TASK_ID

wechat_ocr_dir = "C:\Users\Administrator\AppData\Roaming\Tencent\WeChat\XPlugin\Plugins\WeChatOCR\7071\extracted\WeChatOCR.exe"
wechat_dir = "C:\Program Files\Tencent\WeChat\[3.9.9.43]"

def ocr_result_callback(img_path: str, results: dict):
result_file = os.path.basename(img_path) + ".json"
print(f"识别成功,img_path: {img_path}, result_file: {result_file}")
with open(result_file, 'w', encoding='utf-8') as f:
f.write(json.dumps(results, ensure_ascii=False, indent=2))

def main():
ocr_manager = OcrManager(wechat_dir)
# 设置WeChatOcr目录
ocr_manager.SetExePath(wechat_ocr_dir)
# 设置微信所在路径
ocr_manager.SetUsrLibDir(wechat_dir)
# 设置ocr识别结果的回调函数
ocr_manager.SetOcrResultCallback(ocr_result_callback)
# 启动ocr服务
ocr_manager.StartWeChatOCR()
# 开始识别图片
ocr_manager.DoOCRTask(r".\img\1.png")
time.sleep(1)
while ocr_manager.m_task_id.qsize() != OCR_MAX_TASK_ID:
pass
# 识别输出结果
ocr_manager.KillWeChatOCR()

if name == "main":
main()

@kanadeblisst00
Copy link
Owner

kanadeblisst00 commented Mar 26, 2024

要不图片传绝对路径试试。问别人前的基本礼貌:自己经过搜索和检查,确认为什么别人能做出来,自己确有问题。

@347377260
Copy link
Author

要不图片传绝对路径试试。问别人前的基本礼貌:自己经过搜索和检查,确认为什么别人能做出来,自己确有问题。

绝对路径也试过了,也是一样。别人都行,就我不行。是我的问题,但是我不知道哪里出问题,所以来问问是不是漏了啥步骤

@NOBB2333
Copy link

有可能是防火墙或者什么其他的墙,可以试试换台电脑 比对实验
我的微信和py 都是使用scoop统一管理环境变量进行安装的,目前基本不会遇到此类问题
建议适应scoop 安装,可以+v 进一步沟通 wx2855813844,为广大windwos用户推广scoop而努力

@347377260
Copy link
Author

有可能是防火墙或者什么其他的墙,可以试试换台电脑 比对实验 我的微信和py 都是使用scoop统一管理环境变量进行安装的,目前基本不会遇到此类问题 建议适应scoop 安装,可以+v 进一步沟通 wx2855813844,为广大windwos用户推广scoop而努力

谢谢大哥,我先用scoop安装py和微信试试

@kanadeblisst00
Copy link
Owner

那我也帮不了什么忙了,我这边复现不了这种情况的话,也调试不了。光靠猜肯定是猜不出来的,你可以等等有没有其他人也遇到这种问题

@NOBB2333
Copy link

有可能是防火墙或者什么其他的墙,可以试试换台电脑 比对实验 我的微信和py 都是使用scoop统一管理环境变量进行安装的,目前基本不会遇到此类问题 建议适应scoop 安装,可以+v 进一步沟通 wx2855813844,为广大windwos用户推广scoop而努力

谢谢大哥,我先用scoop安装py和微信试试

我建议你直接加我 我有一套完整的手册,各种国内源,你自己搞 最少3天起步,2周保底

@347377260
Copy link
Author

那我也帮不了什么忙了,我这边复现不了这种情况的话,也调试不了。光靠猜肯定是猜不出来的,你可以等等有没有其他人也遇到这种问题

大佬,已经确定了 应该是CPU问题,这个有些CPU不支持 有人回复也遇到过这种情况

@347377260
Copy link
Author

那我也帮不了什么忙了,我这边复现不了这种情况的话,也调试不了。光靠猜肯定是猜不出来的,你可以等等有没有其他人也遇到这种问题

大佬,有人问过了,说是CPU问题。如果大佬想调试我这边可以搞个远程给大佬调试EEEEhex/QQImpl#1 (comment)

@xinye0123
Copy link

我也是同样问题,很奇怪哦,为什么微信自己能用,程序调用就不行呢,按理说CPU问题,那可能是逆向漏了什么细节

@lhj5426
Copy link

lhj5426 commented Aug 18, 2024

image
遇到了 同样的问题 哈哈

@go1go1go1
Copy link

+1我也是卡这里了 只能换电脑了吗?

@crazyqf
Copy link

crazyqf commented Dec 14, 2024

同样卡在了这里,搞了一天 没一个版本能用 原来不是我一个人

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants