Gnome Builder的Python依赖项

问题描述 投票:0回答:1

我正在学习如何在python中创建GTK应用程序,并且我正在使用通过flatpak安装的Gnome Builder IDE。我想在我的应用程序中使用python包requests,所以我添加了:

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

到我的Flatpak modules文件中的.json列表。当我尝试构建项目时,当命令运行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'

一种解决方案是在用户空间上安装依赖项,但是该怎么做?

python linux gtk flatpak gnome-builder
1个回答
0
投票

我之前已经成功使用了此代码段:

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

/app目录是可写的,您的应用程序的其余部分也应该存在。

© www.soinside.com 2019 - 2024. All rights reserved.