Linux build / unable to find Python path

Hallo, i’ve succefully build blender from Source in Linux. However when launching with ./blender -b, it is not launching and i get this error:
`Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘/netscratch/dongmo/blender-git/build_linux/bin/blender’
isolated = 1
environment = 0
user site = 0
safe_path = 1
import site = 1
is in build tree = 0
stdlib dir = ‘/home/builder/build_linux/deps_x64/Release/python/lib/python3.11’
sys._base_executable = ‘/usr/bin/python’
sys.base_prefix = ‘/home/builder/build_linux/deps_x64/Release/python’
sys.base_exec_prefix = ‘/home/builder/build_linux/deps_x64/Release/python’
sys.platlibdir = ‘lib’
sys.executable = ‘/usr/bin/python’
sys.prefix = ‘/home/builder/build_linux/deps_x64/Release/python’
sys.exec_prefix = ‘/home/builder/build_linux/deps_x64/Release/python’
sys.path = [
‘/home/builder/build_linux/deps_x64/Release/python/lib/python311.zip’,
‘/home/builder/build_linux/deps_x64/Release/python/lib/python3.11’,
‘/home/builder/build_linux/deps_x64/Release/python/lib/python3.11/lib-dynload’,
]
Internal error initializing Python!
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

Current thread 0x00007f2b360ee780 (most recent call first):
`

I’m new to blender, what does this mean ? does the isolated pathon from blender fail ? How to solve this ? Thank you very much for any help, it’s a school project and it will save me.

Make sure you have run the install step. E.g. if you’re using ninja, after compiling you also need to run ninja install in the build folder.

So I followed the instructions given here for debian/ubuntu: Linux - Blender Developer Documentation
I didn’t see this step there. So as i’m using make, should i go to the build_linux folder and run make install ?

You should be able to run make install yes.
I’m a bit surprised that this is not in the build steps. Seems like an oversight.
CC @ThomasDinges

EDIT: The install step is alrady part of the make command.

Actually, looking at the makefile, it should already run the install step. Can you check if you see this part of the output when you ran make ?

I didn’d get it when running make. To be sure of where i have to run my ./blender -b command. It is in the build_linux/bin as in the image 1 or in /usr/local/. as in image 2 :


image 1


image 2

Is the blender quit at the end of second image correct ?

Yes that looks correct! If you run blender without any other command line options in background mode, it won’t do anything and quit. Try e.g. ./blender -b --python-console to get an interactive python shell within the instance.

thank you alot. I’m not sure but it seems the make install didn’t work well when running make. Because i got all these after running make install. Not sure but the documentation says the executable should be in the build_linux folder. I will invest it and let know if there is an issues/bug with build and report

1 Like