Ice9Coffee / HoshinoBot

A qqbot for Princess Connect Re:Dive (and other usage :)
GNU General Public License v3.0
1.41k stars 411 forks source link

cannot import name 'message_preprocessor' from 'nonebot' #247

Closed sgpublic closed 1 year ago

sgpublic commented 1 year ago

服务器上还装了另一个基于 NoneBot v11 的机器人,安装了 HoshinoBot 之后运行报错:

[root@VM-4-7-centos HoshinoBot]# python3 run.py
Traceback (most recent call last):
  File "/root/HoshinoBot/run.py", line 1, in <module>
    import hoshino
  File "/root/HoshinoBot/hoshino/__init__.py", line 7, in <module>
    from nonebot import message_preprocessor
ImportError: cannot import name 'message_preprocessor' from 'nonebot' (/usr/local/lib/python3.10/site-packages/nonebot/__init__.py)

请问是依赖环境问题吗?

服务器环境已安装的依赖 ``` aiocache==0.11.1 aiocqhttp==1.4.2 aiodns==3.0.0 aiofiles==0.8.0 aiohttp==3.8.1 aiosignal==1.2.0 anyio==3.6.1 appdirs==1.4.4 APScheduler==3.9.1 arrow==1.2.2 asgiref==3.5.2 async-timeout==4.0.2 attrs==22.1.0 beautifulsoup4==4.9.3 binaryornot==0.4.4 blinker==1.5 bs4==0.0.1 CacheControl==0.12.11 cachy==0.3.0 cattrs==22.1.0 cchardet==2.1.7 certifi==2022.6.15 cffi==1.15.1 chardet==4.0.0 charset-normalizer==2.0.12 chevron==0.14.0 cleo==1.0.0a5 click==8.1.3 cloudscraper==1.2.64 colorama==0.4.5 cookiecutter==1.7.3 crashtest==0.3.1 cryptography==38.0.1 cycler==0.11.0 distlib==0.3.6 dulwich==0.20.46 exceptiongroup==1.0.0rc9 fastapi==0.78.0 filelock==3.8.0 fonttools==4.33.3 frozenlist==1.3.1 fuzzywuzzy==0.18.0 greenlet==1.1.2 h11==0.12.0 h2==4.1.0 hpack==4.0.0 html5lib==1.1 httpcore==0.15.0 httptools==0.4.0 httpx==0.23.0 hypercorn==0.14.3 hyperframe==6.0.1 idna==3.3 itsdangerous==2.1.2 jaraco.classes==3.2.2 jeepney==0.8.0 Jinja2==2.11.3 jinja2-time==0.2.0 jmespath==1.0.1 jsonschema==4.15.0 keyring==23.9.1 kiwisolver==1.4.3 langid==1.1.6 littlepaimon-utils==1.0.2 lockfile==0.12.2 loguru==0.6.0 lxml==4.9.1 Markdown==3.3.7 MarkupSafe==1.1.1 matplotlib==3.2.2 more-itertools==8.14.0 msgpack==1.0.4 multidict==6.0.2 nb-cli==0.6.7 nonebot==1.8.0 nonebot-adapter-onebot==2.1.1 nonebot-plugin-apscheduler==0.1.3 nonebot-plugin-gocqhttp==0.5.5 nonebot-plugin-htmlrender==0.1.0 nonebot2==2.0.0b4 numpy==1.22.4 packaging==21.3 peony-twitter==2.1.2 pexpect==4.8.0 Pillow==9.1.1 pipdeptree==2.2.1 pkginfo==1.8.3 platformdirs==2.5.2 playwright==1.23.0 poetry==1.2.0 poetry-core==1.1.0 poetry-plugin-export==1.0.6 poyo==0.5.0 priority==2.0.0 prompt-toolkit==3.0.29 psutil==5.9.1 ptyprocess==0.7.0 py-cpuinfo==8.0.0 pycares==4.2.2 pycparser==2.21 pydantic==1.9.1 pyee==8.1.0 pyfiglet==0.8.post1 Pygments==2.12.0 pygtrie==2.3.3 pylev==1.4.0 pymdown-extensions==9.5 pyparsing==3.0.9 pyrsistent==0.18.1 python-dateutil==2.8.2 python-dotenv==0.20.0 python-magic==0.4.27 python-markdown-math==0.8 python-slugify==6.1.2 pytz==2022.1 pytz-deprecation-shim==0.1.0.post0 PyYAML==6.0 Quart==0.14.1 requests==2.28.0 requests-cache==0.9.6 requests-toolbelt==0.9.1 rfc3986==1.5.0 SecretStorage==3.3.3 shellingham==1.5.0 six==1.16.0 sniffio==1.2.0 sogou-tr-free==0.0.11 soupsieve==2.3.2.post1 sqlitedict==2.0.0 starlette==0.19.1 text-unidecode==1.3 tinydb==4.1.1 toml==0.10.2 tomlkit==0.11.4 tqdm==4.64.0 typing_extensions==4.2.0 tzdata==2022.1 tzlocal==4.2 url-normalize==1.4.3 urllib3==1.26.9 uvicorn==0.17.6 uvloop==0.16.0 virtualenv==20.16.5 watchfiles==0.15.0 watchgod==0.8.2 wcwidth==0.2.5 webencodings==0.5.1 websockets==10.1 Werkzeug==1.0.1 wsproto==0.15.0 XlsxWriter==3.0.3 yarl==1.7.2 zhconv==1.4.3 ```
CMHopeSunshine commented 1 year ago

nonebot1和nonebot2不能共存,用虚拟环境隔离开吧

sgpublic commented 1 year ago

重置系统后使用虚拟环境后解决,谢谢大佬!