无法在嵌入式系统上启动python3

时间:2017-08-09 01:52:00

标签: python

我正在使用Ubuntu上的交叉编译器方法在运行linux的mips CPU上构建python 3.4.4。

现在我已经成功构建了python3并将其安装在mips系统上。

但是当在mips系统上运行python3时,它无法启动python3 shell。

/lib/python3.4 # echo $PYTHONPATH
/lib/python3.4/
/lib/python3.4 # echo $PYTHONHOME
/bin
/lib/python3.4 # python3 -v
import _frozen_importlib # frozen
import imp # builtin
import sys # builtin
# installing zipimport hook
# installed zipimport hook
# possible namespace for /lib/python3.4/encodings
import 'encodings' # None
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: no codec search functions registered: can't find encoding

Current thread 0x00000400 (most recent call first):
Aborted
/lib/python3.4 #

我检查了python源代码,发现错误是从Python-3.4.4 \ Python \ codecs.c中的函数_PyCodec_Lookup()报告的。

/* Next, scan the search functions in order of registration */
    args = PyTuple_New(1);
    if (args == NULL)
        goto onError;
    PyTuple_SET_ITEM(args,0,v);

    len = PyList_Size(interp->codec_search_path);
    if (len < 0)
        goto onError;
    if (len == 0) {
        PyErr_SetString(PyExc_LookupError,
                        "no codec search functions registered: "
                        "can't find encoding");
        goto onError;
    }

之前有人遇到过这个问题或交叉编译器构建有什么问题吗?

由于

0 个答案:

没有答案