HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.39k stars 604 forks source link

ImportError: cannot import name 'connections' from 'tortoise' #1450

Closed Nenot233 closed 1 year ago

Nenot233 commented 1 year ago

玩依赖给自己玩崩了 Package Version


absl-py 1.2.0 addict 2.4.0 aiocache 0.11.1 aiocqhttp 1.4.4 aiodns 3.0.0 aiofiles 0.8.0 aiohttp 3.8.4 aiohttp-socks 0.8.0 aiomysql 0.1.1 aiosignal 1.2.0 aiosqlite 0.17.0 alembic 1.10.3 amis-python 1.0.6 anyio 3.6.2 appdirs 1.4.4 APScheduler 3.9.1.post1 arrow 1.2.3 asgiref 3.5.2 async-generator 1.10 async-timeout 3.0.1 asyncio 3.4.3 asyncpg 0.27.0 atlastk 0.13.2 attrs 22.2.0 audioread 2.1.9 baike 1.5.0 basicsr 1.4.1 bbcode 1.1.0 beautifulsoup4 4.12.2 bilireq 0.2.3.post0 black 22.10.0 blinker 1.5 Brotli 1.0.9 CacheControl 0.12.11 cachetools 5.2.0 cachy 0.3.0 cattrs 22.2.0 cchardet 2.1.7 certifi 2022.12.7 cffi 1.15.1 chardet 4.0.0 charset-normalizer 2.0.12 cleo 1.0.0a5 click 8.1.3 cn2an 0.5.17 colorama 0.4.6 commonmark 0.9.1 contourpy 1.0.6 crashtest 0.3.1 cssselect 1.1.0 cycler 0.11.0 Cython 0.29.32 dateparser 1.1.1 DateTime 4.7 decorator 5.1.1 deep-translator 1.9.0 dill 0.3.5.1 diskcache 5.4.0 distlib 0.3.6 dulwich 0.20.46 ecdsa 0.18.0 EdgeGPT 0.0.56.2 efinance 0.5.0 emoji 1.7.0 exceptiongroup 1.1.0 facexlib 0.2.4 fastapi 0.95.0 feedparser 6.0.10 filelock 3.8.0 filetype 1.2.0 filterpy 1.4.5 Flask 2.2.3 fonttools 4.38.0 frozenlist 1.3.1 fst-pso 1.8.1 future 0.18.2 FuzzyTM 2.0.5 fuzzywuzzy 0.18.0 gensim 4.3.0 gfpgan 1.3.4 gino 1.0.1 gitdb 4.0.9 GitPython 3.1.27 google-auth 2.10.0 google-auth-oauthlib 0.4.6 greenlet 2.0.1 grpcio 1.51.1 h11 0.14.0 h2 4.1.0 hpack 4.0.0 html5lib 1.1 httpcore 0.16.3 httptools 0.5.0 httpx 0.23.1 huggingface-hub 0.12.0 hypercorn 0.14.3 hyperframe 6.0.1 idna 3.4 ImageHash 4.3.1 imageio 2.21.0 importlib-metadata 5.2.0 inflect 5.6.2 iniconfig 1.1.1 init 0.1.0 install 1.3.5 iso8601 1.1.0 itsdangerous 2.1.2 jaraco.classes 3.2.3 jieba 0.42.1 jieba-fast 0.53 Jinja2 3.1.2 jiojio 1.2.2 jionlp 1.4.18 joblib 1.1.0 jsonpath 0.82 jsonschema 4.16.0 keyring 23.9.3 kiwisolver 1.4.4 langid 1.1.6 librosa 0.9.2 llvmlite 0.36.0 lmdb 1.3.0 lockfile 0.12.2 loguru 0.6.0 lxml 4.6.5 magneturi 1.3 Mako 1.2.4 Markdown 3.4.1 MarkupSafe 2.1.1 matplotlib 3.6.2 meme-generator 0.0.9 miniful 0.0.6 mockingbirdforuse 0.2.3 more-itertools 9.0.0 msgpack 1.0.4 multidict 6.0.3 multiprocess 0.70.13 multitasking 0.0.11 mypy-extensions 0.4.3 netifaces 0.10.6 networkx 2.8.5 nonebot-adapter-onebot 2.2.2 nonebot-plugin-apscheduler 0.2.0 nonebot-plugin-datastore 0.6.2 nonebot-plugin-guild-patch 0.2.3 nonebot-plugin-htmlrender 0.2.0.1 nonebot-plugin-imageutils 0.1.7 nonebot-plugin-localstore 0.4.1 nonebot-plugin-morning 0.2.2 nonebot-plugin-picsearcher 0.1.8 nonebot-plugin-tortoise-orm 0.0.1a3 nonebot-plugin-txt2img 0.1.4 nonebot2 2.0.0rc4 numba 0.53.0 numpy 1.24.0 oauthlib 3.2.0 openai 0.27.0 opencv-python 4.6.0.66 opencv-python-headless 4.6.0.66 outcome 1.2.0 packaging 22.0 pandas 1.4.4 pathos 0.2.8 pathspec 0.10.3 pdfminer3k 1.3.4 peewee 3.15.3 pexpect 4.8.0 picimagesearch 3.7.2 pikpakapi 0.0.7 pil-utils 0.1.6 Pillow 9.3.0 pip 23.1.2 pkginfo 1.8.3 platformdirs 2.6.0 playwright 1.29.0 pluggy 1.0.0 ply 3.11 poetry 1.2.2 poetry-core 1.3.2 poetry-plugin-export 1.1.2 pooch 1.6.0 pox 0.3.1 ppft 1.7.6.5 prettytable 3.2.0 priority 2.0.0 proces 0.1.3 protobuf 4.21.12 psutil 5.9.2 ptyprocess 0.7.0 py 1.11.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycares 4.2.1 pycparser 2.21 pydantic 1.10.7 pydub 0.25.1 pyee 9.0.4 pyFUME 0.2.25 Pygments 2.13.0 pygtrie 2.5.0 pylev 1.4.0 pymdown-extensions 9.9 PyMySQL 1.0.3 pyparsing 3.0.9 pypika-tortoise 0.1.6 pypinyin 0.46.0 pypng 0.20220715.0 pyppeteer 1.0.2 pyquery 1.4.3 pyrsistent 0.18.1 PySocks 1.7.1 pytest 7.2.0 pytest-base-url 2.0.0 pytest-playwright 0.3.0 python-dateutil 2.8.2 python-dotenv 0.21.0 python-jose 3.3.0 python-markdown-math 0.8 python-multipart 0.0.5 python-qbittorrent 0.4.3 python-slugify 6.1.2 python-socks 2.2.0 pytz 2022.7 pytz-deprecation-shim 0.1.0.post0 PyWavelets 1.4.1 pywin32-ctypes 0.2.0 PyYAML 5.4.1 qbittorrent 0.1.6 qrcode 7.4.2 quart 0.18.4 realesrgan 0.2.5.0 regex 2022.10.31 requests 2.27.1 requests-oauthlib 1.3.1 requests-toolbelt 0.9.1 resampy 0.3.1 retry 0.9.2 retrying 1.3.3 rfc3986 1.5.0 rich 12.6.0 rsa 4.9 ruamel.yaml 0.17.21 ruamel.yaml.clib 0.2.7 scikit-image 0.19.3 scikit-learn 1.1.2 scipy 1.9.3 selenium 4.4.3 setuptools 58.1.0 setuptools-scm 7.1.0 sgmllib3k 1.0.0 shellingham 1.5.0 simpful 2.10.0 six 1.16.0 slate 0.5.2 smart-open 6.2.0 smmap 5.0.0 sniffio 1.3.0 socketio 0.2.1 sortedcontainers 2.4.0 SoundFile 0.10.3.post1 soupsieve 2.3.2.post1 SQLAlchemy 2.0.9 sqlalchemy2-stubs 0.0.2a29 starlette 0.26.1 tb-nightly 2.10.0a20220806 tenacity 8.1.0 tencentcloud-sdk-python 3.0.723 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.1 terminal 0.4.0 text-unidecode 1.3 thefuzz 0.19.0 threadpoolctl 3.1.0 tifffile 2022.8.3 tiktoken 0.3.2 tinydb 4.7.0 tls-client 0.1.8 tokenizers 0.12.1 toml 0.10.2 tomli 2.0.1 tomlkit 0.11.6 torch 1.12.0 torchvision 0.13.1 tortoise 0.1.1 tortoise-orm 0.19.3 tqdm 4.64.0 transformers 4.27.1 trio 0.21.0 trio-websocket 0.9.2 tweepy 4.14.0 typing_extensions 4.4.0 tzdata 2022.7 tzlocal 4.2 ua-parser 0.16.1 ujson 5.5.0 Unidecode 1.3.4 urllib3 1.25.11 user-agents 2.2.0 uvicorn 0.22.0 virtualenv 20.16.5 watchfiles 0.18.1 watchgod 0.8.2 wcwidth 0.2.5 webencodings 0.5.1 webrtcvad 2.0.10 websockets 10.4 wenxin-api 0.0.4 Werkzeug 2.2.3 wheel 0.37.1 win32-setctime 1.1.0 windows-curses 2.3.0 wordcloud 1.8.2.2 wsproto 1.2.0 yapf 0.32.0 yarl 1.8.2 zhconv 1.4.3 zipfile36 0.1.3 zipp 3.11.0 zope.interface 5.4.0

PS D:\BOT\zhenxun_bot> python bot.py Traceback (most recent call last): File "D:\BOT\zhenxun_bot\bot.py", line 3, in from services.db_context import init, disconnect File "D:\BOT\zhenxun_bot\services__init.py", line 1, in from .db_context import * File "D:\BOT\zhenxun_bot\services\dbcontext.py", line 6, in from tortoise.models import Model as Model File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\models.py", line 25, in from tortoise import connections ImportError: cannot import name 'connections' from 'tortoise' (C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\init__.py)

Nenot233 commented 1 year ago

06-12 11:44:26 [ERROR] uvicorn | Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\starlette\routing.py", line 677, in lifespan async with self.lifespan_context(app) as maybe_state: File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\starlette\routing.py", line 566, in aenter await self._router.startup() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\starlette\routing.py", line 654, in startup await handler() File "D:\BOT\zhenxun_bot\utils\browser.py", line 21, in start_browser _browser = await _playwright.chromium.launch() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\playwright\async_api_generated.py", line 14007, in launch await self._impl_obj.launch( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\playwright_impl_browser_type.py", line 93, in launch Browser, from_channel(await self._channel.send("launch", params)) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\playwright_impl_connection.py", line 44, in send return await self._connection.wrap_api_call( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\playwright_impl_connection.py", line 419, in wrap_api_call return await cb() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\playwright_impl_connection.py", line 79, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: Browser closed.

Browser output:

C:\Users\Administrator\AppData\Local\ms-playwright\chromium-1041\chrome-win\chrome.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=C:\Users\ADMINI1\AppData\Local\Temp\playwright_chromiumdev_profile-L690Bd --remote-debugging-pipe --no-startup-window pid=23592 logs C:\Users\Administrator\AppData\Local\ms-playwright\chromium-1041\chrome-win\chrome.exe --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=C:\Users\ADMINI1\AppData\Local\Temp\playwright_chromiumdev_profile-L690Bd --remote-debugging-pipe --no-startup-window pid=23592 06-12 11:44:26 [ERROR] uvicorn | Application startup failed. Exiting. 越玩越寄
nmiabdfhmy commented 2 months ago

How to fix this?