Closed lindow2009 closed 2 years ago
@lindow2009 when opening issues, please be thorough. We need your OS specs, FreeCAD specs. How are you trying to call FreeCAD with Python?
Doing a cursory search on the error gives this solution: https://stackoverflow.com/a/1100297
Issue description environment:centos 7 version:0.19.4
python code: import FreeCAD import Part import Mesh shape = Part.Shape() shape.read('my_shape.step') doc = App.newDocument('Doc') pf = doc.addObject("Part::Feature","MyShape") pf.Shape = shape Mesh.export([pf], 'my_shape.stl')
error code : import FreeCAD as App ImportError: libFreeCADApp.so: cannot open shared object file: No such file or directory
The snap is not meant to provide a python module for the host system. All modules and libraries need the snap's environment to function properly. If you want to hack around in the snap's python environment, you can access the console via freecad.cmd
. You can also add your extension in ~/snap/freecad/common
and develop it that way.
@ppd Sorry, I don't quite understand. Can you give me an example
@lindow2009 You can only use the python modules from within the snap. You can execute your python code by creating a macro, or even a workbench. I suggest starting with https://wiki.freecadweb.org/Macros. In this way, your script will be executed in the correct environment where it will find all python modules contained in the snap.
I have successfully installed freecad with snap, but I can't call it with Python. Errors are reported as follows: ImportError: libFreeCADApp.so: cannot open shared object file: No such file or directory