(Problem) PySide2.QtUiTools and PySide2.QtXml are dependencies of CfdOF but not of FreeCAD

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

Post Reply
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

(Problem) PySide2.QtUiTools and PySide2.QtXml are dependencies of CfdOF but not of FreeCAD

Post by vocx »

I've been testing the CfdOF examples in openSim.

Everything seems to go well, however, when I try to input a CFD boundary condition an error occurs.

Code: Select all

Traceback (most recent call last):
  File "/home/vocx/.FreeCAD/Mod/CfdOF/_ViewProviderCfdFluidBoundary.py", line 94, in setEdit
    import _TaskPanelCfdFluidBoundary
  File "/home/vocx/.FreeCAD/Mod/CfdOF/_TaskPanelCfdFluidBoundary.py", line 37, in <module>
    import CfdFaceSelectWidget
  File "/home/vocx/.FreeCAD/Mod/CfdOF/CfdFaceSelectWidget.py", line 47, in <module>
    from PySide import QtUiTools
  File "/usr/share/freecad/Ext/PySide/QtUiTools.py", line 1, in <module>
    from PySide2.QtUiTools import *
<class 'ModuleNotFoundError'>: No module named 'PySide2.QtUiTools'
It complains about missing PySide2.QtUiTools, so I install this package.

Code: Select all

sudo apt install python3-pyside2.qtuitools
Then I try again to add the boundary conditions and it fails again.

Code: Select all

Traceback (most recent call last):
  File "/home/vocx/.FreeCAD/Mod/CfdOF/_ViewProviderCfdFluidBoundary.py", line 94, in setEdit
    import _TaskPanelCfdFluidBoundary
  File "/home/vocx/.FreeCAD/Mod/CfdOF/_TaskPanelCfdFluidBoundary.py", line 37, in <module>
    import CfdFaceSelectWidget
  File "/home/vocx/.FreeCAD/Mod/CfdOF/CfdFaceSelectWidget.py", line 47, in <module>
    from PySide import QtUiTools
  File "/usr/share/freecad/Ext/PySide/QtUiTools.py", line 1, in <module>
    from PySide2.QtUiTools import *
<class 'ImportError'>: could not import module 'PySide2.QtXml'
It complains about missing PySide2.QtXml, so I install this package as well.

Code: Select all

sudo apt install python3-pyside2.qtxml
With the two dependencies satisfied, CfdOF finally shows the task panel to set up the boundary conditions.

I have FreeCAD installed from the freecad-stable repository, but it seems the two packages mentioned aren't required dependencies, so they aren't automatically pulled by FreeCAD. Either the freecad package should be updated with this information, or CfdOF should check these two packages as dependencies together with PySide2.

Code: Select all

apt-cache depends freecad-python3

freecad-python3
  Depends: freecad-common
  Depends: freecad-runtime
  Depends: python3-matplotlib
  Depends: python3-pivy
  Depends: python3-pyside2.qtcore
  Depends: python3-pyside2.qtgui
  Depends: python3-pyside2.qtsvg
  Depends: python3-pyside2.qtwidgets
  Depends: python3-pyside2uic
  Depends: libfreecad-python3-0.18
  Depends: libfreecad-python3-0.18
  Depends: libc6
  Depends: libgcc1
  Depends: libpython3.6
  Depends: libqt5core5a
  Depends: libqt5widgets5
  Depends: libstdc++6
  Conflicts: <libfreecad-python2-0.17>
  Breaks: <libfreecad-python2-0.17>
  Replaces: <libfreecad-python2-0.17>
Another option is to avoid using PySide2.QtUiTools and PySide2.QtXml. How much are they used in CfdOF?

Code: Select all

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Last edited by vocx on Thu Apr 25, 2019 11:00 pm, edited 2 times in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: (Problem) PySide2.QtUiTools and PySide2.QtXml are dependencies of CfdOF but not of FreeCAD

Post by kkremitzki »

This is a packaging bug that has been mentioned to me a few times before but fell through the cracks, gonna fix it at salsa.debian.org/science-team/freecad and then have updates flow from there.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: (Problem) PySide2.QtUiTools and PySide2.QtXml are dependencies of CfdOF but not of FreeCAD

Post by vocx »

kkremitzki wrote: Thu Apr 25, 2019 10:32 pm This is a packaging bug that has been mentioned to me a few times before but fell through the cracks, gonna fix it at salsa.debian.org/science-team/freecad and then have updates flow from there.
Great.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply