我的 python 工作区中有两个需要 sip.pyd 的模块
Module1.pyd 需要 sip.pyd(实现 v 8.0-8.1)
Module2.pyd 需要 sip.pyd(另一个文件,实现 v6.0)
所以我不能只选择较新的,这是行不通的:我必须同时保留它们!
(RuntimeError: the sip module implements API v6.0 but the fbx module requires API v8.1)
如何以 .pyd 扩展名(python dll,不可编辑)导入模块,并指定要获取哪个 sip.pyd?
至于解决方法,我设法做到了:
- 一个 sip.pyd 在我的根站点包位置。
- 如果我必须导入需要其他 sip.pyd 的模块,我会从 sys.path 中删除根路径,并在其他 sip.pyd 所在的位置附加精确的文件夹路径。
- 我可以导入我的模块并恢复以前的 sys.path。