error loading mesh - new_Mesh: locale::facet::_S_create_c_locale name not valid

Asked by Arnd Flatten

I installed FEniCS on debian ("wheezy 7.0 beta 2 amd64), but get the following error when trying to load a mesh from file, e.g.

from dolfin import *
mesh = Mesh("meshfile.xml.gz")

the error is the following:

Traceback (most recent call last):
  File "error_load_mesh.py", line 2, in <module>
    mesh = Mesh("meshfile.xml.gz")
  File "/usr/lib/python2.7/dist-packages/dolfin/cpp.py", line 9376, in __init__
    _cpp.Mesh_swiginit(self,_cpp.new_Mesh(*args))
RuntimeError: locale::facet::_S_create_c_locale name not valid

what am I missing?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Johannes Ring
Solved:
Last query:
Last reply:
Revision history for this message
Best Johannes Ring (johannr) said :
#1

I tried installing FEniCS on Debian wheezy and it works fine for me.

The error message suggests that it is an issue with your locale settings. What do you get if you type "locale" (without the quotes) in a terminal? I suspect it will work if you do

  export LANG=C
  export LC_ALL=C

and then try to load the mesh in Python.

Revision history for this message
Arnd Flatten (aflatten) said :
#2

In fact I have different locale settings for root (who installed fenics) and as user (who wants to run the fenics problem). When running fenics as root, this error does not occur.

Revision history for this message
Arnd Flatten (aflatten) said :
#3

Thanks Johannes Ring, that solved my question.

Revision history for this message
Anders Logg (logg) said :
#4

On Thu, Oct 11, 2012 at 12:06:16PM -0000, Arnd Flatten wrote:
> Question #210723 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/210723
>
> Arnd Flatten posted a new comment:
> In fact I have different locale settings for root (who installed fenics)
> and as user (who wants to run the fenics problem). When running fenics
> as root, this error does not occur.

I would recommend not running as root.

--
Anders