【发布时间】:2017-10-06 14:49:07
【问题描述】:
我have a library,由3个文件组成,打算放在站点python目录中。
FbxCommon.py
fbxsip.so
fbx.so
一旦这些文件就位,Python 就可以看到fbx 包。这个系统是如何工作的? SO 文件里面是什么?
如果它是一个 DLL,它怎么可能依赖于 python 版本(它适用于 python 3.3,但不适用于 python 3.5)
更新
区分代码如下
from fbx import *
lSdkManager = FbxManager.Create()
在 Python 3.3 上它什么也不做,而在 Python 3.5 上它抛出这个错误:
Traceback (most recent call last):
File "/opt/pycharm-2017.2.2/helpers/pydev/pydevd.py", line 1599, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "/opt/pycharm-2017.2.2/helpers/pydev/pydevd.py", line 1026, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/opt/pycharm-2017.2.2/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/dims/PycharmProjects/FBXCheck/fbxcheck.py", line 2, in <module>
lSdkManager = FbxManager.Create()
AttributeError: type object 'FbxManager' has no attribute 'Create'
【问题讨论】:
-
我不明白你在写一个库并询问导入的问题吗?
-
我不是在写库,我对架构细节感兴趣。 SO 文件如何适用于 Python 3.3 但不适用于 Python 3.5
标签: linux python-3.x binaryfiles dynamic-linking