致命错误:ImportError: No module named site

原因:python解释器无法找到python库。

解决办法:

方法1.在调用Py_Initialize之前,手动设置python搜索目录:Py_SetPythonHome("F:/workspace/test/python")。

方法2.添加python环境变量:PYTHONPATH。


转载注明出处:http://blog.csdn.net/you_lan_hai



相关文章:

  • 2022-01-22
  • 2021-06-01
  • 2021-11-15
  • 2022-12-23
  • 2021-07-17
  • 2021-05-23
猜你喜欢
  • 2021-09-04
  • 2021-06-23
  • 2021-06-17
  • 2021-09-03
  • 2021-10-03
  • 2022-12-23
  • 2021-06-19
相关资源
相似解决方案