• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
64 views

Problem :

On installing Anaconda on Ubantu getting below Python error on miss-typed commands
fatal python error: py_initialize: unable to get the locale encoding
by (6.9k points)  
edited by

1 Answer

0 votes

Solution:

I have also faced similar issues in the past , so I traced it back to how bash handles "command not found". In Ubuntu 14.04 

/etc/bash.bashrc has the following function:

if [ -x /usr/lib/command-not-found ]; then
    function command_not_found_handle {
        # check because c-n-f could've been removed in the meantime
        if [ -x /usr/lib/command-not-found ]; then
            /usr/bin/python /usr/lib/command-not-found -- $1
            return $?
        else
           return 127
        fi
    }
fi

Further Readings:

https://github.com/GrahamDumpleton/mod_wsgi/issues/336

by (33.3k points)  
edited by
...