Search code examples
pythonscrapygtkflatpak

Error when adding scrapy to flatpak project


I'm building a flatpak builded gnome-builder project. Now I want to add scrapy to my project. I use flatpak-pip-generator to generate scrapy package and add it in my manifest like:

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

But when I run I get the following error:

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

And if I add "python3-setuptools_rust" it leads to this error:

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

Any idea to solve this problem? Tks in advance


Solution

  • Have you tried upgrading your pip to the latest, I saw it in your log, maybe give it a try.