BlenderProc
BlenderProc copied to clipboard
A way to opt out of `pip install`
Describe your feature request
I would like to be able to deploy blenderproc in a static environment, with all the dependencies (python, PYTHONPATH, blender) pre-deployed and read-only. More specifically, I'd like to have an opt-in way to prevent blenderproc from trying to modify the environment it runs in, and have it test assertions about the environment instead. I would also like to be able to deploy blenderproc without keeping pip around at runtime.
Describe a possible solution
As an example, one could introduce a flag (maybe an environment variable) that would tell blenderproc not toignore the environment user might have set up for blenderproc and not to run pip install. With such flag set, blenderproc could refer to the .dist-info files in the pre-set PYTHONPATH, instead of pip freeze, to learn about the installed python packages and assert all the necessary ones are present and compatible.
In fact, it should be safe even to make this the default behaviour for the entire blenderproc package, and have the cli() function set an opt-in flag that would enable the pip-related logic
Thanks!
Hey @SomeoneSerge,
thanks for the idea. I think a flag which prevents any automatic pip installs would definitely be doable, however using a user-given PYTHONPATH is probably not so easy. Blender uses its own python environment, thats why blenderproc takes care of its own package installations, as using the ones from the users python environment would probably not work.
But, there should be a way to already have a static environment:
If you run blenderproc once, such that all necessary pip packages are installed, then you end up with a blender installation containing all the right pip packages.
Now you can copy that blender folder into your static environment and tell blenderproc via --custom-blender-path to use that blender folder. As it contains already all necessary pip packages, no new pip installs should be necessary.