将 scrapy 添加到 flatpak 项目时出错

Error when adding scrapy to flatpak project

我正在构建一个 flatpak 构建的 gnome-builder 项目。现在我想将 scrapy 添加到我的项目中。我使用 flatpak-pip-generator 生成 scrapy 包并将其添加到我的清单中,如:

"modules": [
  "python3-cryptography",
  "python3-scrapy.json",
  {
    "name": "other-modules"
  }
]

但是当我 运行 我得到以下错误:

Building module python3-cryptography in /home/huydq/.var/app/org.gnome.Builder/cache/gnome-builder/flatpak-builder/build/python3-cryptography-8
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "cryptography" --no-build-isolation
Using pip 21.2.4 from /usr/lib/python3.9/site-packages/pip (python 3.9)
Looking in links: file:///run/build/python3-cryptography
Processing ./cryptography-36.0.1.tar.gz
    Running command /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmplxldpoc4

            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:

            Upgrade to the latest pip and try again. This will fix errors for most
            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
            =============================DEBUG ASSISTANCE==========================

    Traceback (most recent call last):
      File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
        main()
      File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 151, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/usr/lib/python3.9/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/usr/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    Preparing wheel metadata ... error
WARNING: Discarding file:///run/build/python3-cryptography/cryptography-36.0.1.tar.gz. Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmplxldpoc4 Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement cryptography (from versions: 36.0.1)
ERROR: No matching distribution found for cryptography
Error: module python3-cryptography: Child process exited with code 1

如果我添加“python3-setuptools_rust”,则会导致此错误:

ERROR:Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

有解决这个问题的办法吗?提前谢谢

你试过把你的pip升级到最新版本吗,我在你的日志里看到了,也许试试吧。