Blender Python Initilization Crash? #35785
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#35785
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%--- Operating System, Graphics card ---
Fedora 18 - Intel HD 3000
Blender-2.67-SVN57516-x86_64-GNU-Linux < does not work
Starting Blender it crashes and am left with the following on terminal:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
I have attached a backtrace file. Version 57284 worked fine, just happens with recent version. I was using the same custom build of python 3.2 in all builds.
%%%
Changed status to: 'Open'
%%%I also tried doing a fresh build of Python and Blender. Made no difference still got the crash.%%%
%%%This error message typically happens when the python library (libpython3.3m.so) can be found but the "encodings" dir cant'. be found.
Try run:
strace ./blender.bin 2>&1 | grep encoding
For me the output shows...
stat("/usr/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/lib/python3.3/encodings/init.cpython-33m.so", 0x7fffc4b79190) = -1 ENOENT (No such file or directory)
stat("/usr/lib/python3.3/encodings/init.abi3.so", 0x7fffc4b79190) = -1 ENOENT (No such file or directory)
stat("/usr/lib/python3.3/encodings/init.so", 0x7fffc4b79190) = -1 ENOENT (No such file or directory)
stat("/usr/lib/python3.3/encodings/init.py", {st_mode=S_IFREG|0644, st_size=5067, ...}) = 0
stat("/usr/lib/python3.3/encodings/init.py", {st_mode=S_IFREG|0644, st_size=5067, ...}) = 0
As you can see, its found eventually.%%%
%%%When i run strace I get:
write(2, "Fatal Python error: Py_Initializ"..., 69Fatal Python error: Py_Initialize: Unable to get the locale encoding
write(2, "No module named 'encodings'", 27No module named 'encodings') = 27
Older version of Blender with the same version of python seem to work ok.
Anything else I can try.%%%
%%%Also with a working version I get this (svn 57284 with same version of python):
[terry@TERRY-LAPTOP bin]$ strace ./blender 2>&1 | grep encoding
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/init.cpython-33m.so", 0x7fff6db20610) = -1 ENOENT (No such file or directory)
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/init.abi3.so", 0x7fff6db20610) = -1 ENOENT (No such file or directory)
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/init.so", 0x7fff6db20610) = -1 ENOENT (No such file or directory)
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/init.py", {st_mode=S_IFREG|0644, st_size=5067, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/init.py", {st_mode=S_IFREG|0644, st_size=5067, ...}) = 0
open("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/pycache/init.cpython-33.pyc", O_RDONLY) = 12
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 12
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/aliases.py", {st_mode=S_IFREG|0644, st_size=15133, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/aliases.py", {st_mode=S_IFREG|0644, st_size=15133, ...}) = 0
open("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/pycache/aliases.cpython-33.pyc", O_RDONLY) = 12
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/utf_8.py", {st_mode=S_IFREG|0644, st_size=1005, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/utf_8.py", {st_mode=S_IFREG|0644, st_size=1005, ...}) = 0
open("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/pycache/utf_8.cpython-33.pyc", O_RDONLY) = 12
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/latin_1.py", {st_mode=S_IFREG|0644, st_size=1264, ...}) = 0
stat("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/latin_1.py", {st_mode=S_IFREG|0644, st_size=1264, ...}) = 0
open("/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python/lib/python3.3/encodings/pycache/latin_1.cpython-33.pyc", O_RDONLY) = 12
read(12, "ct_encoding\tJISX0201.1976-0:GR\n}"..., 4096) = 110
%%%
%%%Yet more investigating and I found something odd, directory names have changed between:
/home/terry/BLENDERBINARIES/Blender-2.67-SVN57284-x86_64-GNU-Linux/share/blender/2.67/python
and
/home/terry/BLENDERBINARIES/Blender-2.67-SVN57518-x86_64-GNU-Linux/share/blender/2.67/python
57284 has a lib directory, 57518 has lib64.
Is this a cmake change I didn't know about?%%%
%%%And just to clarify I didn't change any build options between the two builds. So what I mean to say is did something in cmake change that altered where the python lib directories get placed?%%%
%%%Further update, manually renaming the lib64 directory to lib, makes the newer version run fine. So i am innocent its all cmakes fault! :P%%%
%%%Yet another update apparently some clever dev type/sneaky bugger added a new cmake option PYTHON_LIBPATH and since I didn't set it, it set its value to /usr/lib64. Even though I had already set PYTHON_LIBRARY.%%%
%%%This sneaky bugger could have been me, though a few people have been updating CMake's Python support.
There is a problem that Python sometimes uses lib64 and exactly how to fix this isn't so clear, especially if its working on developers systems.
Can you confirm if a clean build with CMake gives this problem?%%%
%%%if you build blender and get errors you need to help us find a solution if we can't redo the error since developers don't have all configurations available for testing.
But this is a build issue which we don't handle in the tracker.
closing.%%%
Changed status from 'Open' to: 'Archived'
%%%Just a note: I got this error running any version of Blender (without building or anything) just by having a very long path to the binary file.
Like: "/media/Drive/Folder/AnotherFolder/OtherFolder/ThatsLong/Tellyou: This is a very long path (2011.11~2012.06+2012.12)/LastFolder"
Or maybe it was because of the colon, parenthesis, tilde or plus signal in the name?%%%
Added subscriber: @VukGardasevic
Sorry for the thread necromancy, but just to make note here for possibly showing up in search results:
An another reason for the error can be the folders (lib, icons, 2.79) being locked - not enough privileges for access. That can happen during unpacking of the tar.bz archive in certain cases using some file managers that display the contents of the archive. In that case, re-extracting the files will solve the issue.
Added subscriber: @dniku
Saw this crash when I tried to replace the Python bundled in the Snap package using a bind mount, as suggested in this answer . Perhaps the Snap read-only file system is the culprit here?