Updating python components during a flatpak build

Hi, I am working on a project that uses python3. How can you use updated pip and other newer packages? My runtime version is 21.08, as is my base version. I would like to keep those the same. All attempts to update packages like cython are stopped with errors that the file system is read only. Here is some output from a section of my yaml manifest file.

   build-commands:
      - cython --version ## I would like 0.29.32
      - python3 --version
      - which python3
      - python3 -m pip install --upgrade pip ## I'd like to use latest

This is the output.

    Running: cython --version
    Cython version 0.29.28
    Running: python3 --version
    Python 3.9.9
    Running: which python3
    /usr/bin/python3
    Running: python3 -m pip install --upgrade pip
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: pip in /usr/lib/python3.9/site-packages (22.0.4)

Is there a way to set up some kind of virtual environment for python in a flatpak?

use runtime 22.08 it has Python 3.10 and more recent stuff.

You can also install pip in the proper prefix instead of update. But note that the build has to be offline, so pip won’t be able to download anything.

I don’t understand what you mean by “in the proper prefix”…