Py_Initialize: Unable to get the locale encoding #42966

Closed
opened 2014-12-20 00:04:24 +01:00 by Bob Kuczewski · 23 comments

System Information
Linux

Blender Version
Broken: 2.72, 2014-12-10 16:04 Hash: d7e4944

Short description of error
When run from another directory, blender fails to run.

Exact steps for others to reproduce the error
Create a symbolic link to blender in another location in user's path (such as ~/bin).
Run blender via that link.
Blender will flash a window frame for a fraction of a second with this error message:

user:~/proj/MCell/cellblender_git$ blender273tb1 &
  • 6046
user:~/proj/MCell/cellblender_git$ Color management: using fallback mode for management
connect failed: No such file or directory
BLF_lang_init: 'locale' data path for translations not found, continuing
Read new prefs: ~/.config/blender/2.72/config/userpref.blend
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Note that upon searching for the error, I found a post at BlenderArtists describing a similar problem in 2.61:

 http://blenderartists.org/forum/archive/index.php/t-240278.html

The poster (Arnaud) solved a similar problem by running from Blender's installation directory. This worked in my case as well.

**System Information** Linux **Blender Version** Broken: 2.72, 2014-12-10 16:04 Hash: d7e4944 **Short description of error** When run from another directory, blender fails to run. **Exact steps for others to reproduce the error** Create a symbolic link to blender in another location in user's path (such as ~/bin). Run blender via that link. Blender will flash a window frame for a fraction of a second with this error message: ``` user:~/proj/MCell/cellblender_git$ blender273tb1 & ``` - [x] 6046 ``` user:~/proj/MCell/cellblender_git$ Color management: using fallback mode for management connect failed: No such file or directory BLF_lang_init: 'locale' data path for translations not found, continuing Read new prefs: ~/.config/blender/2.72/config/userpref.blend Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' ``` Note that upon searching for the error, I found a post at BlenderArtists describing a similar problem in 2.61: ``` http://blenderartists.org/forum/archive/index.php/t-240278.html ``` The poster (Arnaud) solved a similar problem by running from Blender's installation directory. This worked in my case as well.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @BlenderHawk-1

Added subscriber: @BlenderHawk-1
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Julian Eisel self-assigned this 2014-12-20 02:06:07 +01:00
Member

Added subscriber: @mont29

Added subscriber: @mont29
Member

Hey Bob,
This is a well known and expected issue. AFAIK this happens because Blender can't find python. So first make sure you've got Python 3.4 installed (think it should be in PATH too). @mont29 correct me if I'm wrong ;)

Anyway, thanks for the report, but no real Blender related bug here :)

Hey Bob, This is a well known and expected issue. AFAIK this happens because Blender can't find python. So first make sure you've got Python 3.4 installed (think it should be in PATH too). @mont29 correct me if I'm wrong ;) Anyway, thanks for the report, but no real Blender related bug here :)
Author

Hello Julian,

Unless I'm mistaken (which is certainly possible), I'm pretty sure this worked properly in 2.72 and all earlier versions back to 2.62 (when I started using Blender).

Would you mind checking again just to be sure?

Thanks.
Bob

Hello Julian, Unless I'm mistaken (which is certainly possible), I'm pretty sure this worked properly in 2.72 and all earlier versions back to 2.62 (when I started using Blender). Would you mind checking again just to be sure? Thanks. Bob

Added subscriber: @MartijnBerger

Added subscriber: @MartijnBerger

This is not related to python being installed or not I think, iirc current blender is rather picky on Windows, because we had to add a 'blender launcher' to work around a bug in py/msvc2013, a simplistic app that sets a few environment variables before starting the real blender, and so trying to launch blender from shortcuts or so is not easy...

Martijn knows better the details, but afaik there is no bug here.

This is not related to python being installed or not I think, iirc current blender is rather picky on Windows, because we had to add a 'blender launcher' to work around a bug in py/msvc2013, a simplistic app that sets a few environment variables before starting the real blender, and so trying to launch blender from shortcuts or so is not easy... Martijn knows better the details, but afaik there is no bug here.
Member

@mont29, Report says he's using Linux
I just remember I had a similar issue (also Linux), which was fixed by installing the right Python version (3.4)

@mont29, Report says he's using Linux I just remember I had a similar issue (also Linux), which was fixed by installing the right Python version (3.4)

Eeeek right :/

But thing is, python is distributed with our releases, so there should ba absolutely no need to install it.

Eeeek right :/ But thing is, python is distributed with our releases, so there should ba absolutely no need to install it.
Member

well, maybe Python cannot be found using symbolic links

well, maybe Python cannot be found using symbolic links
Author

I think Python is bundled into Blender, so there should be no need to install a separate version.

Furthermore, it has worked without fail in all versions I've used: 2.62, 2.64a, 2.65a, 2.66, 2.66a, 2.68a, 2.69, 2.70, 2.70a, 2.71, 2.72b. I've only had problems in 2.73 (2.73-testbuild1-linux-glibc211-x86_64).

In all cases, I've installed (unzipped) the tar.bz2 file into a subfolder in my directory tree (/home/bob/Blender/downloads). I then place a symbolic link from my own "bin" directory to the binary. So here's what that looks like in my "bin" directory:

lrwxrwxrwx 1 bob bob 82 Feb 26 2013 blender264 -> /home/bob/Blender/downloads/blender-2.64a-linux-glibc27-i686/blender
lrwxrwxrwx 1 bob bob 83 Feb 26 2013 blender265 -> /home/bob/Blender/downloads/blender-2.65a-linux-glibc211-i686/blender
lrwxrwxrwx 1 bob bob 84 Feb 27 2013 blender266 -> /home/bob/Blender/downloads/blender-2.66-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 85 Mar 7 2013 blender2661 -> /home/bob/Blender/downloads/blender-2.66a-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 85 Sep 12 2013 blender268 -> /home/bob/Blender/downloads/blender-2.68a-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 84 Nov 27 2013 blender269 -> /home/bob/Blender/downloads/blender-2.69-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 85 Jun 24 15:54 blender270a -> /home/bob/Blender/downloads/blender-2.70a-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 88 Mar 6 2014 blender270rc1 -> /home/bob/Blender/downloads/blender-2.70-RC1-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 84 Jul 29 12:08 blender271 -> /home/bob/Blender/downloads/blender-2.71-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 85 Oct 23 16:52 blender272 -> /home/bob/Blender/downloads/blender-2.72b-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 92 Nov 11 18:24 blender2725c -> /home/bob/Blender/downloads/blender-2.72-5c6e333-linux-glibc211-x86_64/blender
lrwxrwxrwx 1 bob bob 95 Dec 19 13:40 blender273tb1 -> /home/bob/Blender/downloads/blender-2.73-testbuild1-linux-glibc211-x86_64/blender

Since my "bin" directory is in my path, I can run any version by typing the name of the link (blender264, blender272, blender273tb1). They all work except blender273tb1. Furthermore, it does actually run Blender, so I don't think it's a permission issue. But as soon as it starts it exits with this fatal error:

  user:~/proj/MCell/cellblender_git$ blender273tb1 &
- [x] 6046
  user:~/proj/MCell/cellblender_git$ Color management: using fallback mode for management
  connect failed: No such file or directory
  BLF_lang_init: 'locale' data path for translations not found, continuing
  Read new prefs: ~/.config/blender/2.72/config/userpref.blend
  Fatal Python error: Py_Initialize: Unable to get the locale encoding
  ImportError: No module named 'encodings'

I can continue to work just by changing my directory and launching it from there, but it took me a while to figure that out and that might be true for others as well. Since there was a report on this same problem in 2.61 on BlenderArtists:

   http://blenderartists.org/forum/archive/index.php/t-240278.html

It might be a lead as to why this is happening in 2.73 test build 1.

Thanks for your time.

I think Python is bundled into Blender, so there should be no need to install a separate version. Furthermore, it has worked without fail in all versions I've used: 2.62, 2.64a, 2.65a, 2.66, 2.66a, 2.68a, 2.69, 2.70, 2.70a, 2.71, 2.72b. I've only had problems in 2.73 (2.73-testbuild1-linux-glibc211-x86_64). In all cases, I've installed (unzipped) the tar.bz2 file into a subfolder in my directory tree (/home/bob/Blender/downloads). I then place a symbolic link from my own "bin" directory to the binary. So here's what that looks like in my "bin" directory: lrwxrwxrwx 1 bob bob 82 Feb 26 2013 blender264 -> /home/bob/Blender/downloads/blender-2.64a-linux-glibc27-i686/blender lrwxrwxrwx 1 bob bob 83 Feb 26 2013 blender265 -> /home/bob/Blender/downloads/blender-2.65a-linux-glibc211-i686/blender lrwxrwxrwx 1 bob bob 84 Feb 27 2013 blender266 -> /home/bob/Blender/downloads/blender-2.66-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 85 Mar 7 2013 blender2661 -> /home/bob/Blender/downloads/blender-2.66a-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 85 Sep 12 2013 blender268 -> /home/bob/Blender/downloads/blender-2.68a-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 84 Nov 27 2013 blender269 -> /home/bob/Blender/downloads/blender-2.69-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 85 Jun 24 15:54 blender270a -> /home/bob/Blender/downloads/blender-2.70a-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 88 Mar 6 2014 blender270rc1 -> /home/bob/Blender/downloads/blender-2.70-RC1-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 84 Jul 29 12:08 blender271 -> /home/bob/Blender/downloads/blender-2.71-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 85 Oct 23 16:52 blender272 -> /home/bob/Blender/downloads/blender-2.72b-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 92 Nov 11 18:24 blender2725c -> /home/bob/Blender/downloads/blender-2.72-5c6e333-linux-glibc211-x86_64/blender lrwxrwxrwx 1 bob bob 95 Dec 19 13:40 blender273tb1 -> /home/bob/Blender/downloads/blender-2.73-testbuild1-linux-glibc211-x86_64/blender Since my "bin" directory is in my path, I can run any version by typing the name of the link (blender264, blender272, blender273tb1). They all work except blender273tb1. Furthermore, it does actually run Blender, so I don't think it's a permission issue. But as soon as it starts it exits with this fatal error: ``` user:~/proj/MCell/cellblender_git$ blender273tb1 & ``` - [x] 6046 ``` user:~/proj/MCell/cellblender_git$ Color management: using fallback mode for management connect failed: No such file or directory BLF_lang_init: 'locale' data path for translations not found, continuing Read new prefs: ~/.config/blender/2.72/config/userpref.blend Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' ``` I can continue to work just by changing my directory and launching it from there, but it took me a while to figure that out and that might be true for others as well. Since there was a report on this same problem in 2.61 on BlenderArtists: ``` http://blenderartists.org/forum/archive/index.php/t-240278.html ``` It might be a lead as to why this is happening in 2.73 test build 1. Thanks for your time.
Author

One more thought ...

Could someone test symbolic linked versions of 2.72 and 2.73tb1 to at least verify that 2.72 works in this configuration and 2.73 does not? It's always possible that I've done something else wrong, and that would confirm the validity of report itself on your end. Whether it's a "bug" or a "feature" will then be your call. : )

Thanks again.

One more thought ... Could someone test symbolic linked versions of 2.72 and 2.73tb1 to at least verify that 2.72 works in this configuration and 2.73 does not? It's always possible that I've done something else wrong, and that would confirm the validity of report itself on your end. Whether it's a "bug" or a "feature" will then be your call. : ) Thanks again.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

Yeah, actually, can confirm that. Just download 2.73 testbuild, extract it somewhere in your home dir, and make link to the desktop, that link won't work...

Campbell, Sergey, would we consider this a release blocker? Seems rather annoying to me, and have no real idea about what's happening here.

Yeah, actually, can confirm that. Just download 2.73 testbuild, extract it somewhere in your home dir, and make link to the desktop, that link won't work... Campbell, Sergey, would we consider this a release blocker? Seems rather annoying to me, and have no real idea about what's happening here.

Added subscribers: @Sergey, @ideasman42
Removed subscriber: @MartijnBerger

Added subscribers: @Sergey, @ideasman42 Removed subscriber: @MartijnBerger
Julian Eisel removed their assignment 2014-12-21 19:22:33 +01:00
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Sergey Sharybin self-assigned this 2014-12-21 19:25:27 +01:00
Author

For what it's worth, I certainly wouldn't block your release of 2.73 for this - especially since there are relatively easy work-arounds. I just wanted to get it in the queue to hopefully be fixed in the future.

Thanks very much to all developers who've brought (and continue to bring) us this excellent software.

For what it's worth, I certainly wouldn't block your release of 2.73 for this - especially since there are relatively easy work-arounds. I just wanted to get it in the queue to hopefully be fixed in the future. Thanks very much to all developers who've brought (and continue to bring) us this excellent software.

This issue was referenced by cd4fedb285

This issue was referenced by cd4fedb285a04b1f443623e8ae9548ddaef8088b

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit cd4fedb285.

Closed by commit cd4fedb285.
Author

Super!! When will this appear in a complete test build? The current test build on the web site is still from December 10th, 2014. Is there an automated "build bot" making these somewhere else?

[edit] Sorry, I just found the buildbot area!! [/edit]

Thanks for such quick resolution.

Super!! When will this appear in a complete test build? The current test build on the web site is still from December 10th, 2014. Is there an automated "build bot" making these somewhere else? [edit] Sorry, I just found the buildbot area!! [/edit] Thanks for such quick resolution.
Author

This buildbot version works fine: blender-2.72-646a96b-linux-glibc211-x86_64

Thanks.

This buildbot version works fine: blender-2.72-646a96b-linux-glibc211-x86_64 Thanks.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#42966
No description provided.