一、环境配置和安装

一、环境配置和安装

一、环境配置

环境版本
Python3.9-3.12
OSWindows10+, Windows Server2016+
微信3.9.8+(不支持4.0)

二、安装

1. 开源版

pip install wxauto

2. ✨Plus版

pip install wxautox

# 或指定python版本安装:
py -3.12 -m pip install wxautox

注意

仅支持 Python3.9 至 3.12

激活:

wxautox -a 激活码

wxauto_auth

三、测试运行

from wxauto import WeChat   # 开源版
# from wxautox import WeChat   # ✨Plus版

# 初始化微信实例
wx = WeChat()

# 发送消息
wx.SendMsg("你好", who="文件传输助手")

# 获取当前聊天窗口消息
msgs = wx.GetAllMessage()

for msg in msgs:
    print('==' * 30)
    print(f"{msg.sender}: {msg.content}")

Success

✅ 如果测试运行成功,恭喜您,环境配置完成!