[英]Using PIP to install Pillow in a Flatpak
我在 Python 程序中添加了一個新的 function 程序,當我在我的 PC 上運行該程序時它可以工作,但它在我的 Flatpak 中不起作用。 我認為這可能是因為我 PC 上的 Pillow 版本(8.3.2)比 Flatpak 清單(5.4.1)中的版本更新。 問題是我無法使用更高版本構建 Flatpak。 我不是 PIP 或 Flatpaks 方面的專家。 清單的相關部分:
- 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
Flatpak建設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 ================================================================================================
看起來好像無法下載 tarball,但如果我將地址放入瀏覽器,它就會下載。
問題是 pip 正在$PWD
(/run/build/python3-pillow/) 中搜索文件,但找不到與您的系統和 python 版本匹配的文件。 因此,由於清單文件中的錯誤,您沒有下載任何東西,或者您正在下載錯誤的文件。
我在清單中找不到任何錯誤,至少在您發布的部分上。
您是否嘗試過使用 wheel 文件而不是tar.gz
存檔?
最新pillow
版本的列表在這里。 我不知道您為 flatpak 使用什么運行時,但 (org.freedesktop.Sdk-21.08) 運行時有python v3.9.9
,我可以假設您的應用程序適用於x86_64
,所以我認為Pillow-9.2.0-cp39 -cp39-manylinux_2_28_x86_64.whl應該適合你。
在這里回答:Python 論壇
呸呸呸。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.