For example, we are able to produce Python environments for projects that provide a reqiurements.txt or pyproject.toml by building a site-packages directory containing the required dependencies. Provide a Typescript interface to do so directly, and then run scripts in that environment:
export default () => python.run({ dependencies: ["numpy", ...] }, "import numpy")