Eclipse - pydev - Fatal Python error: Py_Initialize: Unable to get the locale encoding -
i have python 3 script invoking python 2.7.x script, using subprocess.popen.
myproc = subprocess.popen( "/path/to/my/python/3/script", stdout=subprocess.pipe, stderr=subprocess.pipe, cwd=mypwd, shell=true)
when debug script using eclipse , print out stderr see following issue:
fatal python error: py_initialize: unable locale encoding
the issue not seen when execute same code in script outside eclipse.
any solve appreciated!
same problem subprocess.check_call
i've solved mine passing env
subprocess.check_call(cmd,env={'path': '/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games', 'lang': 'it_it.utf-8', })
i think pydev changes environment magic. not sure both path , lang needed.
Comments
Post a Comment