[英]Can't import freecad.so with python3
I have problem while import FreeCAD.so into my module with python3. 使用python3将FreeCAD.so导入我的模块时遇到问题。 When do the same thing with python2 - it works.
当使用python2做同样的事情时-它可以工作。
The source code is simple: 源代码很简单:
import FreeCAD as fc
print(fc)
assert False
I already have /usr/lib/freecad/lib/
in the $PYTHONPATH 我已经在$ PYTHONPATH中有
/usr/lib/freecad/lib/
Python2:
name@name:/mnt/E0CA2445623DA14/Temp/GDrive/__PROJECTS/204_TORPEDO/PIM/trpdalgs/app/Laymodel$ python2 __PetrV_Laymodel.py
FreeCAD 0.16, Libs: 0.16R6707 (Git)
Fasteners workbench Loaded
Sheet Metal workbench loaded
<module 'FreeCAD' from '/usr/lib/freecad/lib/FreeCAD.so'>
Traceback (most recent call last):
File "__PetrV_Laymodel.py", line 8, in <module>
assert False
AssertionError
Python3:
name@name:/mnt/E0CA2445623DA14/Temp/GDrive/__PROJECTS/204_TORPEDO/PIM/trpdalgs/app/Laymodel$ python3 __PetrV_Laymodel.py
Traceback (most recent call last):
File "__PetrV_Laymodel.py", line 6, in <module>
import FreeCAD as fc
ImportError: dynamic module does not define module export function (PyInit_FreeCAD)
FreeCAD doesn't support python3 yet. FreeCAD目前尚不支持python3。 This is being worked on and should be available in a next version
这正在研究中,应该在下一版本中可用
Since time has passed and FreeCAD evolves we have a Python3.6 docker image: 随着时间的流逝和FreeCAD的发展,我们有了一个Python3.6码头工人形象:
https://github.com/ZhukovGreen/docker-freecad-cli https://github.com/ZhukovGreen/docker-freecad-cli
It has a python3.6 version of a freecad-cli. 它具有freecad-cli的python3.6版本。 No GUI yet
还没有GUI
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.