は空sys.path
でインタプリタを初期化しようとCPythonのプログラムです:上記のプログラムを実行するPython 3.5インタプリタを実行するために必要な標準ライブラリモジュールはどれですか?ここ
#include <Python.h>
int main(int argc, char** argv)
{
wchar_t* program = NULL;
wchar_t* sys_path = NULL;
Py_NoSiteFlag = 1;
program = Py_DecodeLocale(argv[0], NULL);
Py_SetProgramName(program);
sys_path = Py_DecodeLocale("", NULL);
Py_SetPath(sys_path);
Py_Initialize();
PyMem_RawFree(program);
PyMem_RawFree(sys_path);
Py_Finalize();
}
は、次のエラーが発生します。
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Current thread 0x00007ffff7fc6700 (most recent call first):
Signal: SIGABRT (Aborted)
だから、Pythonでのパッケージとモジュールの3.5標準ライブラリは、encodings
パッケージのほかに、Python 3.5
インタプリタを実行するために絶対に必要ですか?この情報は私には書類に欠けているようです。
インタプリタを実行し、インポートされたモジュールの辞書を調べて、その内容を確認することができます。 –