JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
580 stars 75 forks source link

Starting Blender with out-of-band Python needs --python-use-system-env #85

Open risa2000 opened 3 years ago

risa2000 commented 3 years ago

I am running Blender with locally installed Python (simply because it has all the libs I need in the scripts). I noticed however that current version will not run, because it will not find "it's Python executable" (environment.py will fail, because bpy.app.binary_path_python is None).

I have tried to replace it with sys.executable (which was suggested by the runtime check), but it did not help. Eventually I figured out that I need to start Blender with --python-use-system-env. The only way to fix it was to modify:

function getBlenderLaunchArgs() {
    return ['--python-use-system-env', '--python', paths_1.launchPath];
}

in blender_executable.js.

I understand that this is not an universal solution, but I do not really know javascript enough to propose anything better.

Apart from that I also modded environment.py to use sys.executable, but this was just a minor fix to squish the warning.

Mateusz-Grzelinski commented 3 months ago

related #113