Giter VIP home page Giter VIP logo

Comments (8)

kexue-z avatar kexue-z commented on September 21, 2024

我是用的官网下的py3.10 然后用poetry虚拟环境运行的 你可以试试

from nonebot-plugin-htmlrender.

kexue-z avatar kexue-z commented on September 21, 2024

使用本项目中的 example 运行在 Win11 x64 中

使用Python版本和Pip

PS D:\git\nonebot-plugin-htmlrender\example> pip --version
pip 22.1.1 from C:\Users\27822\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
PS D:\git\nonebot-plugin-htmlrender\example> python --version
Python 3.10.4

使用的包

Package                   Version
------------------------- -----------
aiofiles                  0.8.0
anyio                     3.6.1
arrow                     1.2.2
asgiref                   3.5.2
binaryornot               0.4.4
certifi                   2022.5.18.1
chardet                   4.0.0
charset-normalizer        2.0.12
click                     8.1.3
colorama                  0.4.4
cookiecutter              1.7.3
fastapi                   0.78.0
greenlet                  1.1.2
h11                       0.12.0
httpcore                  0.15.0
httptools                 0.4.0
httpx                     0.23.0
idna                      3.3
Jinja2                    3.1.2
jinja2-time               0.2.0
loguru                    0.6.0
Markdown                  3.3.7
MarkupSafe                2.1.1
multidict                 6.0.2
nb-cli                    0.6.7
nonebot-adapter-onebot    2.0.0b1
nonebot-plugin-htmlrender 0.0.5
nonebot2                  2.0.0b3
Pillow                    9.1.1
pip                       22.1.1
playwright                1.22.0
poyo                      0.5.0
prompt-toolkit            3.0.29
pydantic                  1.9.1
pyee                      8.1.0
pyfiglet                  0.8.post1
Pygments                  2.12.0
pygtrie                   2.4.2
pymdown-extensions        9.4
python-dateutil           2.8.2
python-dotenv             0.20.0
python-markdown-math      0.8
python-slugify            6.1.2
PyYAML                    6.0
requests                  2.27.1
rfc3986                   1.5.0
setuptools                58.1.0
six                       1.16.0
sniffio                   1.2.0
starlette                 0.19.1
text-unidecode            1.3
tomlkit                   0.10.2
typing_extensions         4.2.0
urllib3                   1.26.9
uvicorn                   0.17.6
watchgod                  0.8.2
wcwidth                   0.2.5
websockets                10.1
win32-setctime            1.1.0
yarl                      1.7.2

直接运行

PS D:\git\nonebot-plugin-htmlrender\example> python .\bot.py
05-30 15:45:00 [SUCCESS] nonebot | NoneBot is initializing...
05-30 15:45:00 [INFO] nonebot | Current Env: dev
05-30 15:45:01 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_htmlrender"
05-30 15:45:01 [SUCCESS] nonebot | Succeeded to import "render"
05-30 15:45:01 [SUCCESS] nonebot | Running NoneBot...
05-30 15:45:01 [WARNING] uvicorn | Current configuration will not reload as not all conditions are met,please refer to documentation.
05-30 15:45:01 [INFO] uvicorn | Started server process [1380]
05-30 15:45:01 [INFO] uvicorn | Waiting for application startup.
05-30 15:45:02 [INFO] nonebot_plugin_htmlrender | Browser Started.
05-30 15:45:02 [INFO] uvicorn | Application startup complete.
05-30 15:45:02 [INFO] uvicorn | Uvicorn running on http://0.0.0.0:9905 (Press CTRL+C to quit)
05-30 15:45:06 [INFO] uvicorn | ('192.168.0.49', 49408) - "WebSocket /onebot/v11/ws" [accepted]
05-30 15:45:06 [INFO] nonebot | OneBot V11 | Bot xxxxxx connected
05-30 15:45:06 [INFO] websockets | connection open
05-30 15:45:08 [SUCCESS] nonebot | ONEBOT V11 3571509319 | [message.group.normal]: Message -278508567 from xxxx@[群:xxxx] "/md2pic test"
05-30 15:45:08 [INFO] nonebot | Event will be handled by <Matcher from plugins.render, type=message, priority=1, temp=False>
05-30 15:45:10 [SUCCESS] nonebot | ONEBOT V11 3571509319 | [message_sent]: {'time': 1653896709, 'self_id': xxxxx, 'post_type': 'message_sent', 'sub_type': 'normal', 'message_type': 'group', 'user_id': xxxxx, 'message': '[CQ:image,file=f75d3877e541065d23e95e9091b0a6c5.image,url=https://gchat.qpic.cn/gchatpic_new/xxxx/xxxx-xx-F75D3xxxxx0A6C5/0?term=255,subType=0]', 'group_id': xxxx, 'message_id': xxx, 'raw_message': '[CQ:image,file=f75d3877e541065d23e95e9091b0a6c5.image,subType=0]', 'message_seq': 1472, 'font': 0, 'anonymous': None, 'sender': {'age': 0, 'area': '', 'card': '', 'level': '', 'nickname': 'Mikko', 'role': 'member', 'sex': 'unknown', 'title': '', 'user_id': xxxxx}}
05-30 15:45:10 [INFO] nonebot | Matcher <Matcher from plugins.render, type=message, priority=1, temp=False> running complete
05-30 15:45:15 [INFO] uvicorn | Shutting down
05-30 15:45:15 [WARNING] nonebot | OneBot V11 | WebSocket for Bot xxxx closed by peer
05-30 15:45:15 [INFO] websockets | connection closed
05-30 15:45:15 [INFO] uvicorn | Waiting for application shutdown.
05-30 15:45:15 [INFO] nonebot_plugin_htmlrender | Browser Stopped.
05-30 15:45:15 [INFO] uvicorn | Application shutdown complete.
05-30 15:45:15 [INFO] uvicorn | Finished server process [1380]

测试结果

发送成功

from nonebot-plugin-htmlrender.

lonevle avatar lonevle commented on September 21, 2024

目前测试是在 async_playwright().start() 时出现错误

from nonebot-plugin-htmlrender.

kexue-z avatar kexue-z commented on September 21, 2024

在你配置文件里 .env.dev.env.pord 里面找到 FASTAPI_RELOAD=true 把他改成 FASTAPI_RELOAD=false

from nonebot-plugin-htmlrender.

lonevle avatar lonevle commented on September 21, 2024

非常感谢, 目前配置FASTAPI_RELOAD=false后, 问题已解决

from nonebot-plugin-htmlrender.

RShock avatar RShock commented on September 21, 2024

我在win10上使用pycharm的debug模式运行时会报这个错误,但是普通的运行就不会,改了.env.dev也没用,我的用的机器人是nonebot衍生的真寻bot,大佬有什么头绪吗

from nonebot-plugin-htmlrender.

kexue-z avatar kexue-z commented on September 21, 2024

去找真寻提issue 他应该用不到我的插件吧

而且这个好像是win的问题

from nonebot-plugin-htmlrender.

RShock avatar RShock commented on September 21, 2024

真寻没用这个插件,是我自己开发用的

from nonebot-plugin-htmlrender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.