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

[Bug]: 使用cx_Freeze 和PyInstaller 打包之后报错 #421

Open
kill136 opened this issue Jan 4, 2024 · 0 comments
Open

[Bug]: 使用cx_Freeze 和PyInstaller 打包之后报错 #421

kill136 opened this issue Jan 4, 2024 · 0 comments

Comments

@kill136
Copy link

kill136 commented Jan 4, 2024

Environment

- wechaty:0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10
- wechaty-plugin-contrib: 
- token type: padlocal|wxwork|xp
- the version of wechaty docker container: [0.65]

Description

Traceback (most recent call last):
  File "D:\AI\chatgpt-on-wechat\channel\chat_channel.py", line 297, in _send
    self.send(reply, context)
  File "D:\AI\chatgpt-on-wechat\channel\wechat\wechaty_channel.py", line 66, in send
    receiver = asyncio.run_coroutine_threadsafe(self.bot.Contact.find(receiver_id), loop).result()
  File "C:\Program Files\Python310\lib\concurrent\futures\_base.py", line 445, in result
    return self.__get_result()
  File "C:\Program Files\Python310\lib\concurrent\futures\_base.py", line 390, in __get_result
    raise self._exception
  File "D:\AI\chatgpt-on-wechat\venv\lib\site-packages\wechaty\user\contact.py", line 216, in find
    contacts = await cls.find_all(query)
  File "D:\AI\chatgpt-on-wechat\venv\lib\site-packages\wechaty\user\contact.py", line 265, in find_all
    contacts = cls._filter_contacts(contacts, query)
  File "D:\AI\chatgpt-on-wechat\venv\lib\site-packages\wechaty\user\contact.py", line 181, in _filter_contacts
    contacts = list(filter(func, contacts))
  File "D:\AI\chatgpt-on-wechat\venv\lib\site-packages\wechaty\user\contact.py", line 148, in filter_func
    if query == payload.id or quit == payload.weixin:
NameError: name 'quit' is not defined

Minimum reproducible code

!/user/bin/env python3

-- coding: utf-8 --

from cx_Freeze import setup, Executable
import sys

print(sys.executable)

print(sys.path)

setup(
name="果果客服",
version="1.0",
description="微信智能客服",
options={
"build_exe": {
"packages": ["wechaty_puppet_service", "sqlalchemy", "builtins"],
"include_files": ["config.json",
("D:\AI\chatgpt-on-wechat\venv\Scripts\python.exe", "Lib\site-packages\builtins.py")]
}
},
executables=[Executable("app.py")],
)

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

1 participant