Python Forum

Full Version: Installing Pillow from remote archive in Linux Flatpak
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got a Flatpak which uses Python and Pillow (among other things). The installation of Pillow (was written for me, had contradictions and probably wasn't right but) worked until I had to update the Pillow version, then Pillow installation failed. It works if I use a local tarball, but that's no good for releasing it on GitHub. It fails when I try using the remote tarball.

This local version works:

modules:
  - name: python3-pillow
    buildsystem: simple
    build-commands:
      - pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} Pillow     							
    sources:
      - type: file
        path: /home/chris/git/Pillow-8.3.2.tar.gz
For this remote version I've removed --no-index --find-links="file://${PWD}" as I was told they are for local files, but it still fails:

modules:
  - name: python3-pillow
    buildsystem: simple
    build-commands:
      - pip3 install --prefix=${FLATPAK_DEST} Pillow
    sources:
      - type: archive
        url: https://github.com/python-pillow/Pillow/archive/refs/tags/8.3.2.tar.gz
        sha256: 8252b6b514aed2743abb5b7259b3253d6c4bf86902b9c5acd33fe79d24ec7b2f
I'd appreciate some help with the PIP commands for installing from a remote archive.
Try with.
build-commands:
  - pip3 install .
Working install remote would be.
pip3 install https://github.com/python-pillow/Pillow/archive/refs/tags/9.2.0.tar.gz
(Sep-22-2022, 10:18 PM)snippsat Wrote: [ -> ]Try with.
build-commands:
  - pip3 install .
Working install remote would be.
pip3 install https://github.com/python-pillow/Pillow/archive/refs/tags/9.2.0.tar.gz
So I now have:
modules:
  - name: python3-pillow
    buildsystem: simple
    build-commands:
      - pip3 install .
      - pip3 install https://github.com/python-pillow/Pillow/archive/refs/tags/9.2.0.tar.gz
It errors with:
========================================================================
Building module python3-pillow in /home/chris/.flatpak-builder/build/python3-pillow-9
========================================================================
Running: pip3 install .
Defaulting to user installation because normal site-packages is not writeable
ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
WARNING: There was an error checking the latest version of pip.
Error: module python3-pillow: Child process exited with code 1
END ================================================================================================
The same as you had before the pip install was just demo how it work outside of flatpack.
name: python3-pillow
buildsystem: simple
build-commands:
  - pip3 install .
sources:
  - type: archive
   url: https://github.com/python-pillow/Pillow/archive/refs/tags/9.2.0.tar.gz
   sha256: <hash for file over>
This worked on my PC, but to make the Flatpak work I had put this parameter back "--prefix=${FLATPAK_DEST}" presumably to ensure that it is installed in the correct Flatpak directory.

modules:
  - name: python3-pillow
    buildsystem: simple
    build-commands:
      - pip3 install . --prefix=${FLATPAK_DEST}
    sources:
      - type: archive
        url: https://github.com/python-pillow/Pillow/archive/refs/tags/8.3.2.tar.gz
        sha256: 8252b6b514aed2743abb5b7259b3253d6c4bf86902b9c5acd33fe79d24ec7b2f
Can I ignore this warning?
Successfully installed Pillow-8.3.2
  WARNING: There was an error checking the latest version of pip.
(Sep-23-2022, 05:48 PM)ChrisOfBristol Wrote: [ -> ]Can I ignore this warning?
Yes,but can also try to upgrade pip(before).
pip3 install --upgrade pip
In flatpack can try this,also mention that i don't use flatpack i just took a quick look at doc.
build-commands:
  - pip3 install --upgrade pip
  - pip3 install .
(Sep-23-2022, 06:05 PM)snippsat Wrote: [ -> ]- pip3 install --upgrade pip
That doesn't work, because it's more complicated for a Flatpak I suppose. I'm not going to worry about it. Thanks for your relevant, expert and unpatronising help.