SAGIRI-kawaii / sagiri-bot

基于Graia Ariadne和Mirai的QQ机器人 SAGIRI-BOT
GNU Affero General Public License v3.0
697 stars 83 forks source link

[Bug Report] 更新 wordcloud #428

Closed mengguyi closed 1 year ago

mengguyi commented 1 year ago

问题

在 arm64 架构的树莓派上安装 sagiri-bot 时由于 wordcloud 无法安装导致 sagiri-bot 无法安装

如何复现

1.使用 Debian 12 系统安装 pip 并在 ~/.config/pip/pip.conf 设置

[global]
break-system-packages = true

以允许 pip 安装 poetry

2.安装 openjdk-17 3.按照文档安装 mirai mirai-api-http 4.克隆仓库 git clone https://github.com/SAGIRI-kawaii/sagiri-bot.git 5.进入 sagiri-bot 所在目录,运行 poetry install 6.得到报错如日志

预期行为

无报错,正常安装完

使用环境

- 系统: Debian 12
- mirai 版本: 2.11.0
- mirai-api-http 版本: 2.5.2
- Python 版本: 3.11.2
- 源码版本: d4eee89f5d67e10b41160543cd61dc8b45e8bcc2
- 其他 Graia 库版本:
- 其他 有关 库版本:

日志/截图

root@rpi4-20230101:/opt/sagiri-bot# poetry install
Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source pypi-public. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'.
Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source USTC. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'.
Creating virtualenv sagiri-bot-3kWJaoJo-py3.11 in /root/.cache/pypoetry/virtualenvs
Installing dependencies from lock file

Package operations: 134 installs, 1 update, 1 removal

  • Removing wheel (0.38.4)
  • Installing certifi (2022.12.7)
  • Installing charset-normalizer (2.1.1)
  • Installing idna (3.4)
  • Updating setuptools (67.7.2 -> 67.0.0)
  • Installing urllib3 (1.26.14)
  • Installing numpy (1.23.5)
  • Installing packaging (23.0)
  • Installing requests (2.28.2)
  • Installing six (1.16.0)
  • Installing typing-extensions (4.4.0)
  • Installing contourpy (1.0.7)
  • Installing cycler (0.11.0)
  • Installing fonttools (4.38.0)
  • Installing kiwisolver (1.4.4)
  • Installing markupsafe (2.1.2)
  • Installing pillow (9.4.0)
  • Installing pycparser (2.21)
  • Installing pyparsing (3.0.9)
  • Installing python-dateutil (2.8.2)
  • Installing setuptools-scm (7.1.0)
  • Installing cffi (1.15.1)
  • Installing imageio (2.25.1)
  • Installing markdown (3.4.1)
  • Installing matplotlib (3.6.3)
  • Installing mdurl (0.1.2)
  • Installing sniffio (1.3.0)
  • Installing zipp (3.12.0)
  • Installing anyio (3.6.2)
  • Installing frozenlist (1.3.3)
  • Installing greenlet (2.0.1)
  • Installing h11 (0.14.0)
  • Installing importlib-metadata (6.0.0)
  • Installing loguru (0.6.0)
  • Installing markdown-it-py (2.1.0)
  • Installing multidict (6.0.4)
  • Installing pycares (4.3.0)
  • Installing pyee (9.0.4)
  • Installing pyyaml (6.0)
  • Installing statv (0.3.2)
  • Installing tqdm (4.64.1)
  • Installing uc-micro-py (1.0.1)
  • Installing aiodns (3.0.0)
  • Installing aiosignal (1.3.1)
  • Installing async-timeout (4.0.2)
  • Installing attrs (22.2.0)
  • Installing bbcode (1.1.0)
  • Installing brotli (1.0.9)
  • Installing click (8.1.3)
  • Installing creart (0.2.2)
  • Installing cssselect (1.2.0)
  • Installing filelock (3.9.0)
  • Installing distlib (0.3.6)
  • Installing httpcore (0.16.3)
  • Installing launart (0.6.3)
  • Installing linkify-it-py (1.0.3)
  • Installing lxml (4.9.2)
  • Installing mdit-py-plugins (0.3.3)
  • Installing opencv-python-headless (4.7.0.72)
  • Installing platformdirs (2.6.2)
  • Installing playwright (1.30.0)
  • Installing pydantic (1.10.4)
  • Installing rfc3986 (1.5.0)
  • Installing smmap (5.0.0)
  • Installing soupsieve (2.3.2.post1)
  • Installing starlette (0.22.0)
  • Installing wcwidth (0.2.6)
  • Installing yarl (1.8.2)
  • Installing aiohttp (3.8.3)
  • Installing beautifulsoup4 (4.11.1)
  • Installing cfgv (3.3.1)
  • Installing creart-graia (0.1.5)
  • Installing croniter (1.3.8)
  • Installing fastapi (0.89.1)
  • Installing filetype (1.2.0)
  • Installing gitdb (4.0.10)
  • Installing graia-amnesia (0.7.1)
  • Installing graia-broadcast (0.19.1)
  • Installing graia-saya (0.0.17)
  • Installing graiax-playwright (0.2.1)
  • Installing httptools (0.5.0)
  • Installing httpx (0.23.1)
  • Installing identify (2.5.17)
  • Installing imageio-ffmpeg (0.4.8)
  • Installing mako (1.2.4)
  • Installing mdit-py-emoji (0.1.0)
  • Installing mypy-extensions (0.4.3)
  • Installing nodeenv (1.7.0)
  • Installing pathspec (0.11.0)
  • Installing pil-utils (0.1.4)
  • Installing prompt-toolkit (3.0.36)
  • Installing pycryptodomex (3.17)
  • Installing pygments (2.14.0)
  • Installing pyquery (2.0.0)
  • Installing python-dotenv (0.21.1)
  • Installing python-multipart (0.0.5)
  • Installing regex (2023.3.23)
  • Installing sqlalchemy (2.0.0)
  • Installing toml (0.10.2)
  • Installing uvicorn (0.20.0)
  • Installing uvloop (0.17.0)
  • Installing virtualenv (20.17.1)
  • Installing watchfiles (0.18.1)
  • Installing websockets (10.4)
  • Installing aiofiles (22.1.0)
  • Installing aiosqlite (0.18.0)
  • Installing alembic (1.9.2)
  • Installing black (23.1a1)
  • Installing bs4 (0.0.1)
  • Installing dacite (1.8.0)
  • Installing exifread (3.0.0)
  • Installing gitpython (3.1.30)
  • Installing graia-ariadne (0.10.3)
  • Installing graia-scheduler (0.1.4)
  • Installing graiax-fastapi (0.2.1)
  • Installing graiax-silkcoder (0.3.5)
  • Installing graiax-text2img-playwright (0.3.0)
  • Installing jieba (0.42.1): Preparing...
  • Installing jinja2 (3.1.2)
  • Installing meme-generator (0.0.4)
  • Installing noneprompt (0.1.7)
  • Installing picimagesearch (3.7.8)
  • Installing pre-commit (3.0.2)
  • Installing psutil (5.9.4): Preparing...
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818): Installing...
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing psutil (5.9.4): Installing...
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing psutil (5.9.4)
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing jinja2 (3.1.2)
  • Installing meme-generator (0.0.4)
  • Installing noneprompt (0.1.7)
  • Installing picimagesearch (3.7.8)
  • Installing pre-commit (3.0.2)
  • Installing psutil (5.9.4)
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing jieba (0.42.1): Installing...
  • Installing jinja2 (3.1.2)
  • Installing meme-generator (0.0.4)
  • Installing noneprompt (0.1.7)
  • Installing picimagesearch (3.7.8)
  • Installing pre-commit (3.0.2)
  • Installing psutil (5.9.4)
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing jinja2 (3.1.2)
  • Installing meme-generator (0.0.4)
  • Installing noneprompt (0.1.7)
  • Installing picimagesearch (3.7.8)
  • Installing pre-commit (3.0.2)
  • Installing psutil (5.9.4)
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  • Installing jieba (0.42.1)
  • Installing jinja2 (3.1.2)
  • Installing meme-generator (0.0.4)
  • Installing noneprompt (0.1.7)
  • Installing picimagesearch (3.7.8)
  • Installing pre-commit (3.0.2)
  • Installing psutil (5.9.4)
  • Installing pymdown-extensions (9.9.2)
  • Installing pypdf2 (3.0.1)
  • Installing pypinyin (0.48.0)
  • Installing python-markdown-math (0.8)
  • Installing pytz (2022.7.1)
  • Installing pyzipper (0.3.6)
  • Installing qrcode (7.3.1)
  • Installing tencentcloud-sdk-python (3.0.818)
  • Installing tiktoken-async (0.3.2)
  • Installing tokenizers (0.13.2)
  • Installing unwind (0.4.0)
  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/__init__.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/tokenization.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/color_from_image.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/_version.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/wordcloud.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/wordcloud_cli.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/__main__.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/stopwords -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/DroidSansMono.ttf -> build/lib.linux-aarch64-cpython-311/wordcloud
  UPDATING build/lib.linux-aarch64-cpython-311/wordcloud/_version.py
  set build/lib.linux-aarch64-cpython-311/wordcloud/_version.py to '1.8.2.2'
  running build_ext
  building 'wordcloud.query_integral_image' extension
  creating build/temp.linux-aarch64-cpython-311
  creating build/temp.linux-aarch64-cpython-311/wordcloud
  aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/tmpbkm0vnxa/.venv/include -I/usr/include/python3.11 -c wordcloud/query_integral_image.c -o build/temp.linux-aarch64-cpython-311/wordcloud/query_integral_image.o
  wordcloud/query_integral_image.c:196:12: fatal error: longintrepr.h: No such file or directory
    196 |   #include "longintrepr.h"
        |            ^~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

  at /usr/local/lib/python3.11/dist-packages/poetry/installation/chef.py:147 in _prepare
      143│
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│
      146│             if error is not None:
    → 147│                 raise error from None
      148│
      149│             return path
      150│
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with wordcloud (1.8.2.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "wordcloud (==1.8.2.2)"'.

root@rpi4-20230101:/opt/sagiri-bot# poetry install
Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source pypi-public. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'.
Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source USTC. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'.
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing wordcloud (1.8.2.2): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-311
  creating build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/__init__.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/tokenization.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/color_from_image.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/_version.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/wordcloud.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/wordcloud_cli.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/__main__.py -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/stopwords -> build/lib.linux-aarch64-cpython-311/wordcloud
  copying wordcloud/DroidSansMono.ttf -> build/lib.linux-aarch64-cpython-311/wordcloud
  UPDATING build/lib.linux-aarch64-cpython-311/wordcloud/_version.py
  set build/lib.linux-aarch64-cpython-311/wordcloud/_version.py to '1.8.2.2'
  running build_ext
  building 'wordcloud.query_integral_image' extension
  creating build/temp.linux-aarch64-cpython-311
  creating build/temp.linux-aarch64-cpython-311/wordcloud
  aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/tmpnycqax1u/.venv/include -I/usr/include/python3.11 -c wordcloud/query_integral_image.c -o build/temp.linux-aarch64-cpython-311/wordcloud/query_integral_image.o
  wordcloud/query_integral_image.c:196:12: fatal error: longintrepr.h: No such file or directory
    196 |   #include "longintrepr.h"
        |            ^~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

  at /usr/local/lib/python3.11/dist-packages/poetry/installation/chef.py:147 in _prepare
      143│
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│
      146│             if error is not None:
    → 147│                 raise error from None
      148│
      149│             return path
      150│
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with wordcloud (1.8.2.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "wordcloud (==1.8.2.2)"'.
mengguyi commented 1 year ago

目前 wordcloud 的版本为 1.9.2。 而 poetry. Lock 中的版本为 1.8.2.2