I am having problem understanding how FreeCAD runs using Python. So I have FreeCAD installed on a remote Linux Machine (Runs Ubuntu 18.04). I installed freecad using the following two commands:
Code: Select all
sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt-get install freecad
Code: Select all
import sys
PATHTOFREECADBINFOLDER = "/usr/lib/freecad/lib/"
sys.path.insert(0, PATHTOFREECADBINFOLDER)
import FreeCAD
sys.exit()
However, I always get the following error:
Code: Select all
import FreeCAD
ImportError: dynamic module does not define init function (initFreeCAD)
Please note that I have tried running this using Python3 and it runs fine! The /usr/lib/ also contains freecad-python3, and if I change the PATHTOFREECADFOLDER to point to this, it run (after creating some symbolic links, as explained in the last comment in the link below)
Code: Select all
https://forum.freecadweb.org/viewtopic.php?t=33684