I'm doing a project, and I use blender to set up a scene (mainly I have two plane meshes) and with scripting I do some operations on the meshes. I installed blender as a python module using conda env and it worked(I can import bpy), but it throws an error that my object doesn't exist, it looks like it can't load the scene from the .blend file I'm trying to run a blender python script without having to install blender, is it possible?

  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Commented Jul 5, 2022 at 10:09
  • $\begingroup$ right now I have a code that I run from blender which means I open the GUI and run the script. the company that I work for want to use this code on servers and they don't want to install blender on their servers. how can I do this? I use pycharm and I managed to import bpy but when I run the code I got an error that the objects I'm trying to modify do not exist even though they do exist in the .blend file. to import bpy in pycharm I used "conda install -c kitsune.one python-blender" (after creating a conda env) $\endgroup$
    – rahaf
    Commented Jul 5, 2022 at 11:24
  • $\begingroup$ Actually much of the python code that depends on the bpy classes are then calling into the blender core application code, so you won't be able to run without blender installed. Even a bpy.ops.wm.open_mainfile will throw an error, should you manage to get the bpy python files installed on the server. $\endgroup$
    – james_t
    Commented Jul 5, 2022 at 11:59
  • $\begingroup$ All answers are in the question that I've shared, aren't they? The module section that I haven't heard about describes a special built of blender, that can be run as a module. I'm not sure that it is a feasible task. So the easier way to do this is to run blender from cmd or python blender --background --python myscript.py $\endgroup$
    – Crantisz
    Commented Jul 5, 2022 at 13:36
  • $\begingroup$ You don't have to install blender to run it. You just download whatever blender build you want to use and run the compiled .exe in the download folder. answer that @Crantisz should work in combination with running the blender.exe from it's location on the server. $\endgroup$
    – Jakemoyo
    Commented Jul 5, 2022 at 13:37


Browse other questions tagged .