flathub / com.riverbankcomputing.PyQt.BaseApp

https://flathub.org/apps/details/com.riverbankcomputing.PyQt.BaseApp
7 stars 5 forks source link

OpenAI Module Install Error #327

Open AuraPy opened 4 months ago

AuraPy commented 4 months ago

I am trying to turn my pyqt5 application into a flatpak but when i run flatpak-builder <My-Build-Directory> <Manifest> I get the error ModuleNotFoundError: No module named 'maturin' when installing the OpenAI module.

If it helps, here is my manifest file:

id: io.github.aurapy.halalgpt
runtime: org.kde.Platform
runtime-version: '5.15-23.08'
sdk: org.kde.Sdk
base: com.riverbankcomputing.PyQt.BaseApp
base-version: '5.15-23.08'
command: halalgpt
rename-icon: HalalGPT
rename-desktop-file: halalgpt.desktop
rename-appdata-file: halalgpt.appdata.xml

modules:
    - name: PyQtWebEngineApp
    - python3-requirements.json

sources:
    - type: file
      path: HalalGPT-linux.py
    - type: file
      path: send.png
    - type: file
      path: settings.png
    - type: file
      path: HalalGPT-linux.py
    - type: file
      path: empty.mp3

finish-args:
    - --share=ipc
    - --share=network
    - --socket=pulseaudio
    - --socket=wayland
    - --socket=fallback-x11
    - --device=dri

cleanup:
    - '/include'
    - '/bin/foo-*'
    - '*.a'

cleanup-commands:
    - 'sed s/foo/bar/ /bin/app.sh'

and here is my requirements file generated using flatpak-pip-generator:

{
    "name": "python3-requirements",
    "buildsystem": "simple",
    "build-commands": [],
    "modules": [
        {
            "name": "python3-openai",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"openai\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/28/78/d31230046e58c207284c6b2c4e8d96e6d3cb4e52354721b944d3e1ee4aa5/annotated_types-0.6.0-py3-none-any.whl",
                    "sha256": "0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl",
                    "sha256": "048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl",
                    "sha256": "dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl",
                    "sha256": "7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl",
                    "sha256": "e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/78/d4/e5d7e4f2174f8a4d63c8897d79eb8fe2503f7ecc03282fee1fa2719c2704/httpcore-1.0.5-py3-none-any.whl",
                    "sha256": "421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/41/7b/ddacf6dcebb42466abd03f368782142baa82e08fc0c1f8eaa05b4bae87d5/httpx-0.27.0-py3-none-any.whl",
                    "sha256": "71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl",
                    "sha256": "82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/16/35/10bb93c51c446370cf760ea0e722c78755bbe0572aeb4663bf8c19c9b082/openai-1.30.1-py3-none-any.whl",
                    "sha256": "c9fb3c3545c118bbce8deb824397b9433a66d0d0ede6a96f7009c95b76de4a46"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/ed/76/9a17032880ed27f2dbd490c77a3431cbc80f47ba81534131de3c2846e736/pydantic-2.7.1-py3-none-any.whl",
                    "sha256": "e029badca45266732a9a79898a15ae2e8b14840b1eabbb25844be28f0b33f3d5"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/e9/23/a609c50e53959eb96393e42ae4891901f699aaad682998371348650a6651/pydantic_core-2.18.2.tar.gz",
                    "sha256": "2e29d20810dfc3043ee13ac7d9e25105799817683348823f305ab3f349b9386e"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl",
                    "sha256": "2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/18/eb/fdb7eb9e48b7b02554e1664afd3bd3f117f6b6d6c5881438a0b055554f9b/tqdm-4.66.4-py3-none-any.whl",
                    "sha256": "b75ca56b413b030bc3f00af51fd2c1a1a5eac6a0c1cca83cbb37a5c52abce644"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/01/f3/936e209267d6ef7510322191003885de524fc48d1b43269810cd589ceaf5/typing_extensions-4.11.0-py3-none-any.whl",
                    "sha256": "c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"
                }
            ]
        },
        {
            "name": "python3-pathlib",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pathlib\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/78/f9/690a8600b93c332de3ab4a344a4ac34f00c8f104917061f779db6a918ed6/pathlib-1.0.1-py3-none-any.whl",
                    "sha256": "f35f95ab8b0f59e6d354090350b44a80a80635d22efdedfa84c7ad1cf0a74147"
                }
            ]
        },
        {
            "name": "python3-pygame",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pygame\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/c6/aa/2c0c867d6cff00966cfc2152b25f61599f87e88b239e4dcb8ad5357f0f69/pygame-2.5.2.tar.gz",
                    "sha256": "c1b89eb5d539e7ac5cf75513125fb5f2f0a2d918b1fd6e981f23bf0ac1b1c24a"
                }
            ]
        },
        {
            "name": "python3-mutagen",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"mutagen\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/b0/7a/620f945b96be1f6ee357d211d5bf74ab1b7fe72a9f1525aafbfe3aee6875/mutagen-1.47.0-py3-none-any.whl",
                    "sha256": "edd96f50c5907a9539d8e5bba7245f62c9f520aef333d13392a79a4f70aca719"
                }
            ]
        },
        {
            "name": "python3-datetime",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"datetime\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/f3/78/8e382b8cb4346119e2e04270b6eb4a01c5ee70b47a8a0244ecdb157204f7/DateTime-5.5-py3-none-any.whl",
                    "sha256": "0abf6c51cb4ba7cee775ca46ccc727f3afdde463be28dbbe8803631fefd4a120"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/9c/3d/a121f284241f08268b21359bd425f7d4825cffc5ac5cd0e1b3d82ffd2b10/pytz-2024.1-py2.py3-none-any.whl",
                    "sha256": "328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"
                }
            ]
        },
        {
            "name": "python3-requests",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"requests\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl",
                    "sha256": "dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/63/09/c1bc53dab74b1816a00d8d030de5bf98f724c52c1635e07681d312f20be8/charset-normalizer-3.3.2.tar.gz",
                    "sha256": "f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl",
                    "sha256": "82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl",
                    "sha256": "58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"
                },
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/a2/73/a68704750a7679d0b6d3ad7aa8d4da8e14e151ae82e6fee774e6e0d05ec8/urllib3-2.2.1-py3-none-any.whl",
                    "sha256": "450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"
                }
            ]
        }
    ]
}

please help and ask if you need further details, thanks.

JakobDev commented 4 months ago

You probably need to include maturin in the list of packages that you install with flatpak-pip-generator.

AuraPy commented 4 months ago

I did but I got another error saying that another module wasnt installed, then i added that into the list and it said that i didnt have the rust-compiler installed?

JakobDev commented 4 months ago

Try adding

sdk-extensions:
  - org.freedesktop.Sdk.Extension.rust-stable
build-options:
    append-path: /usr/lib/sdk/rust-stable/bin

at the top of your Manifest.

AuraPy commented 4 months ago
zayan@nolifemachine:~/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-build$ flatpak-builder /home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-dist /home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-build/io.github.aurapy.halalgpt.yaml --force-clean

(flatpak-builder:15563): Json-WARNING **: 22:09:13.698: Failed to deserialize "build-options" property of type "BuilderOptions" for an object of type "BuilderManifest"

** (flatpak-builder:15563): WARNING **: 22:09:13.700: Unknown property sources for type BuilderManifest
Emptying app dir '/home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-dist'
Downloading sources
Initializing build dir
error: Requested extension org.freedesktop.Sdk.Extension.rust-stable/x86_64/5.15-23.08 not installed
Error: Child process exited with code 1
AuraPy commented 4 months ago

I ran flatpak install flathub org.freedesktop.Sdk.Extension.rust-stable/x86_64/5.15-23.08 but it couldn't find a match

JakobDev commented 4 months ago

You need to run

flatpak install org.freedesktop.Sdk.Extension.rust-stable//23.08

to install it

AuraPy commented 4 months ago
zayan@nolifemachine:~/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-build$ flatpak-builder /home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-dist ./io.github.aurapy.halalgpt.yaml --force-clean

(flatpak-builder:6586): Json-WARNING **: 19:23:11.124: Failed to deserialize "build-options" property of type "BuilderOptions" for an object of type "BuilderManifest"

** (flatpak-builder:6586): WARNING **: 19:23:11.125: Unknown property sources for type BuilderManifest
Emptying app dir '/home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-dist'
Downloading sources
Starting build of io.github.aurapy.halalgpt
Skipping module PyQtWebEngineApp (no sources)
Cache miss, checking out last cache hit
========================================================================
Building module python3-setuptools-rust in /home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-build/.flatpak-builder/build/python3-setuptools-rust-1
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "setuptools-rust" --no-build-isolation
Using pip 24.0 from /usr/lib/python3.11/site-packages/pip (python 3.11)
Looking in links: file:///run/build/python3-setuptools-rust
Processing ./setuptools_rust-1.9.0-py3-none-any.whl
Requirement already satisfied: setuptools>=62.4 in /usr/lib/python3.11/site-packages (from setuptools-rust) (69.4.0)
Processing ./semantic_version-2.10.0-py2.py3-none-any.whl (from setuptools-rust)
Installing collected packages: semantic-version, setuptools-rust
Successfully installed semantic-version-2.10.0 setuptools-rust-1.9.0
Committing stage build-python3-setuptools-rust to cache
========================================================================
Building module python3-maturin in /home/zayan/Documents/Python_Projects/HalalGPT/HalalGPT/flatpak-build/.flatpak-builder/build/python3-maturin-4
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "maturin" --no-build-isolation
Using pip 24.0 from /usr/lib/python3.11/site-packages/pip (python 3.11)
Looking in links: file:///run/build/python3-maturin
Processing ./maturin-1.5.1.tar.gz
  Running command Preparing metadata (pyproject.toml)
  /usr/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:83: SetuptoolsWarning: `install_requires` overwritten in `pyproject.toml` (dependencies)
    corresp(dist, value, root_dir)
  running dist_info
  creating /tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info
  writing /tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/requires.txt
  writing top-level names to /tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/top_level.txt
  writing manifest file '/tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/SOURCES.txt'
  ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
  reading manifest file '/tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.json' under directory 'src/python_interpreter'
  writing manifest file '/tmp/pip-modern-metadata-2t_hiomg/maturin.egg-info/SOURCES.txt'
  creating '/tmp/pip-modern-metadata-2t_hiomg/maturin-1.5.1.dist-info'
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: maturin
  Running command Building wheel for maturin (pyproject.toml)
  /usr/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:83: SetuptoolsWarning: `install_requires` overwritten in `pyproject.toml` (dependencies)
    corresp(dist, value, root_dir)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-311
  creating build/lib.linux-x86_64-cpython-311/maturin
  copying maturin/__init__.py -> build/lib.linux-x86_64-cpython-311/maturin
  copying maturin/__main__.py -> build/lib.linux-x86_64-cpython-311/maturin
  copying maturin/import_hook.py -> build/lib.linux-x86_64-cpython-311/maturin
  running egg_info
  creating maturin.egg-info
  writing maturin.egg-info/PKG-INFO
  writing dependency_links to maturin.egg-info/dependency_links.txt
  writing requirements to maturin.egg-info/requires.txt
  writing top-level names to maturin.egg-info/top_level.txt
  writing manifest file 'maturin.egg-info/SOURCES.txt'
  ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
  reading manifest file 'maturin.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.json' under directory 'src/python_interpreter'
  writing manifest file 'maturin.egg-info/SOURCES.txt'
  running build_ext
  running build_rust
  error: can't find Rust compiler

  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

  To update pip, run:

      pip install --upgrade pip

  and then retry package installation.

  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  error: subprocess-exited-with-error

  × Building wheel for maturin (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python /usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpw2hxc2em
  cwd: /tmp/pip-install-7ikrmdg_/maturin_a660c3fdbe6646a482022c4c72bc6491
  Building wheel for maturin (pyproject.toml) ... error
  ERROR: Failed building wheel for maturin
Failed to build maturin
ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
Error: module python3-maturin: Child process exited with code 1

same error :sob:

JakobDev commented 4 months ago

Can you post your full Manifest?