简体   繁体   中英

Python dependency on Gnome Builder

I am learning how to create GTK applications in python and I am using Gnome Builder IDE installed through flatpak. I wanted to use the python package requests in my application, so I added:

{
    "name": "pip-install",
    "buildsystem": "simple",
    "build-options": {
      "build-args": [
        "--share=network"
      ]
    },
    "build-commands": [
        "pip3 install requests"
    ]
}

To my modules list inside the flatpak .json file of the project. When I try to build the project I get the following error when the command runs pip:

ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/usr/lib/python3.7/site-packages/idna-2.9.dist-info'

One solution would be the dependency being installed on user space, but how to do that?

I've successfully used this snippet before:

    {
        "name": "requests",
        "buildsystem": "simple",
        "build-options": {
          "build-args": [
            "--share=network"
          ]
        },
        "build-commands": [
            "pip3 install --prefix=/app --no-cache-dir requests"
        ]
    }

The /app directory is writable and the rest of your application should be there as well.

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