PYIMPORT_IMPORTMODULE永远不会返回
我实际上是C ++程序员,不得不使用PYBIND11在我的应用程序中运行一些Python代码。一切都很好,但是突然间,我不再可以使用:“ Pyimport_importModule(const char *name)”导入一些Python库。 而导入“系统”和其他人的工作正常,例如导入“ numpy”在该功能中导致永不返回。 不过,使用python命令行效果很好。 上个月发生的唯一变化是我升级为Win10。 重新安装“ numpy”无济于事。
那么,我该如何解决呢?
编辑:相关代码行是:
PyObject *obj = PyImport_ImportModule("numpy");
I'm actually a c++ programmer and had to use pybind11 to get some python code run in my application. Everything was fine, but suddenly I no longer can import some of my python libraries using: 'PyImport_ImportModule(const char *name)'.
Whereas importing 'sys' and others works fine, for example importing 'numpy' results in the function never return.
Using the python command line with 'numpy' works fine, though.
The only thing that changed in the last month was that I upgraded to Win10.
Reinstalling 'numpy' did not help.
So, how could I solve this?
edit: the relevant code line is:
PyObject *obj = PyImport_ImportModule("numpy");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论