I am using a system environment variable PYTHONPATH to use some Python libraries in Houdini. However, this seems to conflict with Blender. For example, I have numpy installed and this breaks Blender's FBX importer. Is it possible to make Blender ignore PYTHONPATH env variable and just use its own internal Python libs?
$\begingroup$
$\endgroup$
3
1 Answer
$\begingroup$
$\endgroup$
1
the PYTHONPATH should not be used unless you pass --python-use-system-env to Blender.
So if the PYTHOHNPATH is interfering with Blender's startup, that's something that should be fixed.
https://projects.blender.org/blender/blender/issues/115648#issuecomment-1076172
As a workaround you can create a .bat file with clearing PYTHONPATH and your Blender path:
set PYTHONPATH=
"C:\Program Files (x86)\Steam\steamapps\common\Blender\blender.exe"
-
$\begingroup$ Thanks unwave, this works for me and I have commented on the forum post. $\endgroup$acc3d– acc3d2024-04-16 18:29:05 +00:00Commented Apr 16, 2024 at 18:29
--python-use-system-env? $\endgroup$C:\Program Files\Blender Foundation\Blender 4.1\blender-launcher.exe$\endgroup$blender -b --python-expr "import sys; print(*sys.path, sep='\n')"and the same but with--factory-startup. $\endgroup$