Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

After reinstalled the python3.2, I got the error as below when call py3compile:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: no codec search functions registered: can't find encoding
Aborted

I know it may be the problem of missing environment variable. But I have no idea of how to fix it. I checked the env output and didn't find any PYTHONXXX variables.

share|improve this question

1 Answer 1

Mind that this is a late response, since someone has offered a bounty on this question. Also note that without reproducing this problem I can't verify if any solution works. I will just suggest a solution here, not provide one.

I think you have to set two variables as outlined here, because py3compile needs to know where certain resources are. It looks them up via these PYTHONXXX variables.

So

export PYTHONPATH='/usr/lib64/python3.21:/usr/lib64/python3.2/lib-dynload:/usr/lib64/python3.2/site-packages'
export PYTHONHOME='/usr/lib64/python3.2'

or rather

export PYTHONPATH='/path/to/pythondir:/path/to/pythondir/lib-dynload:/path/to/pythondir/site-packages'
export PYTHONHOME='/path/to/pythondir'

should do the trick.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.