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

tool工具在win下使用时,总是提示文件被占用导致失败 #30

Closed
lsCoding666 opened this issue Apr 23, 2023 · 1 comment
Closed

Comments

@lsCoding666
Copy link

前置确认

1. 网络能够访问openai接口
2. git pull 拉取最新代码
3. 执行pip install -r requirements.txt,检查依赖是否满足
4. 在已有 issue 中未搜索到类似问题

5. 注意,提issue前请确认用本项目test.py(参考README.md 快速开始配置)重试一次你的问题是否能复现

问题描述

- [WX] receiveMsg=ChatMessage: id=6671363862168960699, create_time=1682256903, ctype=TEXT, content=$tool 搜索今日热点, from_user_id=wxid_k10fvreqzcbf22, from_user_nickname=梁爽, to_user_id=wxid_tt9en9ft8fhf29, to_user_nickname=格蕾修, other_user_id=wxid_k10fvreqzcbf22, other_user_nickname=梁爽, is_group=False, is_at=False, actual_user_id=None, actual_user_nickname=None, context=Context(type=TEXT, content=$tool 搜索今日热点, kwargs={'isgroup': False, 'msg': <channel.wechat.wechaty_message.WechatyMessage object at 0x000002A174536050>, 'origin_ctype': <ContextType.TEXT: 1>, 'session_id': 'wxid_k10fvreqzcbf22', 'receiver': 'wxid_k10fvreqzcbf22'})
[INFO][2023-04-23 21:35:04][victorinox.py:85] - 提问: 搜索今日热点
[INFO][2023-04-23 21:35:10][base.py:107] - 执行Tool: bing-search中...
[INFO][2023-04-23 21:35:10][bot.py:91] - 输入: 今日热点
[WARNING][2023-04-23 21:35:12][chatgpt.py:171] - proxy no find, directly request to chatgpt instead
[ERROR][2023-04-23 21:35:12][victorinox.py:88] - [APP] catch a Exception: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\lhwyw\\AppData\\Local\\Temp\\tmpws2in_jq'
[INFO][2023-04-23 21:35:12][victorinox.py:85] - 提问: 搜索今日热点
[INFO][2023-04-23 21:35:19][base.py:107] - 执行Tool: bing-search中...
[INFO][2023-04-23 21:35:19][bot.py:91] - 输入: 今日热点
[WARNING][2023-04-23 21:35:21][chatgpt.py:171] - proxy no find, directly request to chatgpt instead
[ERROR][2023-04-23 21:35:21][victorinox.py:88] - [APP] catch a Exception: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\lhwyw\\AppData\\Local\\Temp\\tmpl87ynly_'
[ERROR][2023-04-23 21:35:21][victorinox.py:92] - exceed retry_num
[ERROR][2023-04-23 21:35:21][tool.py:103] - 超过重试次数
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\apps\victorinox.py", line 86, in ask
    return self.bot.run(query)
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\chains\base.py", line 212, in run
    return self(args[0])[self.output_keys[0]]
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\chains\base.py", line 115, in __call__
    raise e
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\chains\base.py", line 112, in __call__
    outputs = self._call(inputs)
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\engine\tool_engine.py", line 158, in _call
    next_step_output = self._take_next_step(
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\engine\tool_engine.py", line 123, in _take_next_step
    observation = tool.run(
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\tools\base_tool.py", line 72, in run
    raise e

  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\tools\base_tool.py", line 69, in run
    observation = self._run(tool_input)
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\tools\bing_search\tool.py", line 28, in _run
    return self.api_wrapper.run(query)
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\tools\bing_search\wrapper.py", line 73, in run
    snippets.append(filter_text(result["snippet"]))
  File "C:\Python310\lib\site-packages\chatgpt_tool_hub\tools\web_requests\__init__.py", line 36, in filter_text
    os.remove(file_path)
PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\lhwyw\\AppData\\Local\\Temp\\tmpws2in_jq'

image

url-get和浏览器功能也是 有时会提示被占用,而占用的进程就是python.exe 就是他自己

python 3.10
windows11

@goldfishh
Copy link
Owner

goldfishh commented Apr 23, 2023

你好,感谢反馈,这个bug会出现在win系统,将在0.4.2修复

如果你想现在修复,可以把本项目master分支代码clone到chatgpt-on-wechat目录下

@goldfishh goldfishh mentioned this issue Apr 25, 2023
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

2 participants