fixes https://github.com/jmwright/cadquery-freecad-module/issues/53 and adds freecads library path for archlinux
This commit is contained in:
@ -39,6 +39,7 @@ def _fc_path():
|
||||
"/usr/lib/freecad/lib",
|
||||
"/opt/freecad/lib/",
|
||||
"/usr/bin/freecad/lib",
|
||||
"/usr/lib/freecad",
|
||||
]:
|
||||
if os.path.exists(_PATH):
|
||||
return _PATH
|
||||
@ -94,5 +95,11 @@ def _fc_path():
|
||||
if os.path.exists(_PATH):
|
||||
return _PATH
|
||||
|
||||
#Make sure that the correct FreeCAD path shows up in Python's system path
|
||||
sys.path.insert(0, _fc_path())
|
||||
|
||||
try:
|
||||
import FreeCAD
|
||||
except ImportError:
|
||||
#Make sure that the correct FreeCAD path shows up in Python's system path
|
||||
path = _fc_path()
|
||||
if path: sys.path.insert(0, _fc_path())
|
||||
else: raise ImportError('cadquery was unable to determine freecads library path')
|
||||
|
||||
Reference in New Issue
Block a user