Python对Gnome生成器的依赖性

2024-06-02 07:23:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在学习如何用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.json文件中的我的modules列表。 当我尝试构建项目时,当命令运行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'

一种解决方案是在用户空间上安装依赖项,但如何做到这一点呢


Tags: installpip项目namebuild应用程序gtkpackages
1条回答
网友
1楼 · 发布于 2024-06-02 07:23:54

我以前成功使用过此代码段:

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

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

相关问题 更多 >