How does import work with Boost.Python from inside python files
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Boost.Python to embed an interpreter in my C++ executable and execute some prewritten scripts. I have got it working so that I can call functions in the python file but the python code I want to use imports external files and these imports fail because 'no module named '. If I run the script directly from python everything works as expected however. So my question is what is the correct way of importing modules in python scripts that are being run via C++ bindings? C++ Code: #include "boost/python.hpp" int main(int argc, char**