Unable to get python embedded to work with zip'd library

前端 未结 4 1828
一向
一向 2021-02-09 10:19

I\'m trying to embed python, and provide the dll and a zip of the python libraries and not use any installed python. That is, if a user doesn\'t have python, I want my code to

4条回答
  •  误落风尘
    2021-02-09 11:21

    Note that windows searches for libraries in the executable's path first and only then starts looking in other places. If your python27.dll is always placed in the executable's path and you use LoadLibrary("python27.dll") or bind to the library directly, you just always use the local python version. If the \python27-folder is empty then, your interpreter fails. If the dll is not there, you use the global interpreter.

    Move the dll into a separate folder so windows will only load it if asked for it by LoadLibrary("\p27\python27.dll")

提交回复
热议问题