【问题标题】:Error when adding scrapy to flatpak project将scrapy添加到flatpak项目时出错
【发布时间】:2021-12-25 02:14:42
【问题描述】:

我正在构建一个 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

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

【问题讨论】:

    标签: python scrapy gtk flatpak


    【解决方案1】:

    您是否尝试将您的pip 升级到最新版本,我在您的日志中看到了,不妨试试看。

    【讨论】:

    • 我有另一个关于在 flatpak 项目中使用 scrapy 脚本的问题。你能帮我吗?
    • 如果问题不是太大,可以尝试在这里评论。或者您可以尝试创建另一个包含更多信息的帖子,因为评论部分太小了,我对 Python 不是很了解,但也许我可以提供帮助,如果我不能,其他人肯定会帮助你,也!
    • 非常感谢@Bunny。我必须等待 90 分钟才能创建另一个帖子:v 当我可以发帖时,我会将链接粘贴到此处。
    • 这里是新的问题链接:stackoverflow.com/questions/70477927/…
    • 嗨@Bunny,我刚刚编辑了我的问题。当我再次运行该项目时,它需要加密,但是当我生成加密并添加时,它仍然会出错。您可以查看我编辑的版本
    猜你喜欢
    • 2022-01-18
    • 1970-01-01
    • 2021-07-09
    • 2018-04-25
    • 1970-01-01
    • 1970-01-01
    • 2018-06-26
    • 2013-09-03
    • 1970-01-01
    相关资源
    最近更新 更多