Code: Select all
import PySide
import PySide2
But how can i use these outside of an interactive freecad-daily python shell, and use a standalone python script?
All i want to do is load the Draft module.
Code: Select all
import PySide
import PySide2
What's the thread you wrote about being able to do this ?Cyril wrote: pinged by pinger macro
Code: Select all
import sys
sys.path.append("<path to FreeCAD.so>")
import FreeCAD
import Draft
import PySide2
Code: Select all
import sys
sys.path.append("usr\lib\freecad-daily-python3\lib")
import FreeCAD
import Draft
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/share/freecad-daily/Mod/Draft/Draft.py", line 53, in <module>
from draftutils.utils import ARROW_TYPES as arrowtypes
File "/usr/share/freecad-daily/Mod/Draft/draftutils/utils.py", line 39, in <module>
import PySide.QtCore as QtCore
ModuleNotFoundError: No module named 'PySide'
Code: Select all
pip install pyside
Code: Select all
pip install pyside2
Code: Select all
import Draft
Code: Select all
>>> import Draft
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/share/freecad-daily/Mod/Draft/Draft.py", line 53, in <module>
from draftutils.utils import ARROW_TYPES as arrowtypes
File "/usr/share/freecad-daily/Mod/Draft/draftutils/utils.py", line 39, in <module>
import PySide.QtCore as QtCore
ModuleNotFoundError: No module named 'PySide'
Code: Select all
import sys
for p in sys.path:
print (p)
Code: Select all
/usr/share/freecad-daily/Mod/Idf
/usr/share/freecad-daily/Mod/PartDesign
/usr/share/freecad-daily/Mod/Tux
/usr/share/freecad-daily/Mod/Show
/usr/share/freecad-daily/Mod/Path
/usr/share/freecad-daily/Mod/Robot
/usr/share/freecad-daily/Mod/TechDraw
/usr/share/freecad-daily/Mod/Sketcher
/usr/share/freecad-daily/Mod/Points
/usr/share/freecad-daily/Mod/Raytracing
/usr/share/freecad-daily/Mod/Measure
/usr/share/freecad-daily/Mod/Inspection
/usr/share/freecad-daily/Mod/MeshPart
/usr/share/freecad-daily/Mod/Surface
/usr/share/freecad-daily/Mod/Import
/usr/share/freecad-daily/Mod/Material
/usr/share/freecad-daily/Mod/Fem
/usr/share/freecad-daily/Mod/Mesh
/usr/share/freecad-daily/Mod/Drawing
/usr/share/freecad-daily/Mod/ReverseEngineering
/usr/share/freecad-daily/Mod/Part
/usr/share/freecad-daily/Mod/Start
/usr/share/freecad-daily/Mod/Image
/usr/share/freecad-daily/Mod/OpenSCAD
/usr/share/freecad-daily/Mod/AddonManager
/usr/share/freecad-daily/Mod/Arch
/usr/share/freecad-daily/Mod/Test
/usr/share/freecad-daily/Mod/Draft
/usr/share/freecad-daily/Mod/Spreadsheet
/usr/share/freecad-daily/Mod/Web
/usr/share/freecad-daily/Mod
/usr/lib/freecad-daily-python3/lib
/usr/share/freecad-daily/Ext
/usr/lib/freecad-daily/bin
/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/usr/local/lib/python3.8/dist-packages
/usr/lib/python3/dist-packages
/home/user1/.FreeCAD/Macro
/usr/lib/freecad-daily/Macro
Code: Select all
sys.path.append()
Code: Select all
>>> import Draft
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/share/freecad-daily/Mod/Draft/Draft.py", line 53, in <module>
File "/usr/share/freecad-daily/Mod/Draft/draftutils/utils.py", line 39, in <module>
File "/usr/share/freecad-daily/Ext/PySide/QtCore.py", line 1, in <module>
File "/home/user1/anaconda3/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 146, in _import
ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/user1/anaconda3/lib/python3.8/site-packages/PySide2/QtCore.abi3.so)
Code: Select all
sudo apt-get install qt
Code: Select all
which python3
Code: Select all
/home/user1/anaconda3/bin/python3
Code: Select all
/usr/bin/python3.8