
Consider setting $PYTHONHOME to <prefix>[:<exec
记录备忘.
1.完整报错信 Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: initfsencoding: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings' Current thread 0x00007f5ab301f6c0 (most recent call first): 2.报错原因场景是C++调用python时,找不到python解释器。
3.解决办法在init之前添加解释器位置说明。
Py_SetPythonHome(L"/home/zxq/anaconda3/envs/onnx"); # 再去初始化 Py_Initialize(); printf("Python init \\n"); Py_Finalize();
👁️ 阅读量:0
© 版权声明:本文《Consider setting $PYTHONHOME to <prefix>[:<exec》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686554951a290652.html。