简体   繁体   中英

Using PIP to install Pillow in a Flatpak

I've added a new function to a Python program which works when I run the program on my PC, but it isn't working in my Flatpak. I assumed that it was probably because the Pillow version on my PC (8.3.2) is rather more recent than that in the Flatpak manifest (5.4.1). The problem is that I can't get the Flatpak to build with the later version. I'm no expert on PIP or Flatpaks. Relevant part of manifest:

  - name: python3-pillow
    buildsystem: simple
    build-commands:
      - pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} Pillow
    sources:
      - type: file
        #    url: https://files.pythonhosted.org/packages/3c/7e/443be24431324bd34d22dd9d11cc845d995bcd3b500676bcf23142756975/Pillow-5.4.1.tar.gz
        #    sha256: 5233664eadfa342c639b9b9977190d64ad7aca4edc51a966394d7e08e7f38a9f
        # try later version of pillow
        url: https://github.com/python-pillow/Pillow/archive/refs/tags/8.3.2.tar.gz
        sha256: 8252b6b514aed2743abb5b7259b3253d6c4bf86902b9c5acd33fe79d24ec7b2f

Relevant part of Flatpak building output:

=======================================================================
Building module python3-pillow in /home/me/.flatpak-builder/build/python3-pillow-8
========================================================================
Running: pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} Pillow
Looking in links: file:///run/build/python3-pillow
ERROR: Could not find a version that satisfies the requirement Pillow (from versions: none)
ERROR: No matching distribution found for Pillow
Error: module python3-pillow: Child process exited with code 1
END ================================================================================================

It looks as though it fails to download the tarball, but if I put the address into a browser, it downloads.

The problem is that pip is searching for a file in $PWD (/run/build/python3-pillow/) and it can't find a file that matches your system and your python version. So eather you didn't download any thing due to an error in the manifest file or you are downlaoding the wrong file.

I can't find any errors in the manifest, at least on the part that you posted.

Have you tried to use a wheel file rather then a tar.gz archive?

A list of them for the latest pillow version are here . I don't know what runtime you are using for flatpak but the (org.freedesktop.Sdk-21.08) runtime has python v3.9.9 and i can assume that your app is for x86_64 so i think that Pillow-9.2.0-cp39-cp39-manylinux_2_28_x86_64.whl should work with you.

Answer here:Python Forum

Blah, blah.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM