PySide migration

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PySide migration

Post by NormandC »

jmaustpc wrote:There don't seem to be any DEV packages.
http://packages.ubuntu.com/saucy/libpyside-dev
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: PySide migration

Post by jmaustpc »

normandc wrote:
jmaustpc wrote:There don't seem to be any DEV packages.
http://packages.ubuntu.com/saucy/libpyside-dev
Thanks Norm
Stupid packagemanager...I searched pyside and it does not find that package...I have to search libpyside. I have found this before with other libs, I should have thought of that this time.

Its compiling now ...but this would not doubt be the problem.

Jim
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: PySide migration

Post by jmaustpc »

OK that definitely fix the problem.

Should Cmake have complained when this package was not on my system?
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PySide migration

Post by NormandC »

I guess that means that to produce the .deb packages in the PPA, the libpyside-dev package will have to be added to the build dependencies, even though python-pivy automatically adds python-qt4 as dependency...

I'll have to test and implement this soon or the Daily PPA will be broken in the next day or so.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: PySide migration

Post by wmayer »

Yorik wrote:But I'm not sure how far this is a problem, since after all, nothing impeachs a module to still use PyQt, as long as it doesn't use any of the FreeCAD python functions...
This shouldn't cause a problem because the sogui module checks if sip and PyQt is available, if not it doesn't load them. The only stupid thing is that python-pivy has a dependency to python-qt but this shouldn't cause a real problem.
Jim wrote:Will these changes stop this compile error that I always get?
The reason for the build failure is that the soqt sources have been generated with an older SoQt and Python version. Anyway, you should exclude the build of pivy via cmake.
Jim wrote:Should Cmake have complained when this package was not on my system?
It just prints some status information but doesn't raise an error if libshiboken-dev and libpyside-dev are missing.

Btw, for me the Arch module doesn't load either. It prints this message:
'ascii' codec can't encode character u'\xe4' in position 3: ordinal not in range(128)
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: PySide migration

Post by ulrich1a »

I copied the Pyside addition to the libpack into the existing Libpack for Windows. The compilation was running through. But at starting I got: No module named PySide.
The start-Workbench was empty. I had the same effect on Linux. There I had installed the libpyside-dev packages. So the compilation did run. But I got also: No module named Pyside. It got fixed after installing all the pyside packages.

Is this pyside python code not integrated in the Libpack Pyside-addition?

Ulrich
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: PySide migration

Post by yorik »

jmaustpc wrote:and on starting Arch I get
arguments did not match any overloaded call:
QMainWindow.addDockWidget(Qt.DockWidgetArea, QDockWidget): argument 1 has unexpected type 'PySide.QtCore.Qt.DockWidgetArea'
QMainWindow.addDockWidget(Qt.DockWidgetArea, QDockWidget, Qt.Orientation): argument 1 has unexpected type 'PySide.QtCore.Qt.DockWidgetArea'
Is that error fixed when you installed pyside dev packages? Strange!
jmaustpc wrote:local variable 'translate' referenced before assignment
This happened other times with other people too, I could never find out what was wrong, but it always got solved by wiping your .FreeCAD folder...
wmayer wrote:Btw, for me the Arch module doesn't load either. It prints this message: 'ascii' codec can't encode character u'\xe4' in position 3: ordinal not in range(128)
Ah got it... the problem is in the translations, some non-ascii chars are passed to str()... I'll fix that ASAP. Funny that it worked before!
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: PySide migration

Post by jmaustpc »

No, Yorik, I only got those problems because I was missing the dev package that Norm told me about. :)


It all works perfectly for me now.

My only thought now is why did not Cmake or Make tell me that I had a problem? Should we change something so that Cmake tells me it can't find Pyside dev files?

I had all the pyside packages I could find. But my package manager search would not find the above package libpyside-dev until I searched "libpyside" as distinct from "pyside", very annoying, but nothing to do with FreecAD. :)

Werner said he still has a problem with Arch WB but I don't at least with my current FreeCAD version. I have not looked up yet to see if there is an update from 2964.

OS: Ubuntu 12.04.3 LTS
Platform: 64-bit
Version: 0.14.2964 (Git)
Branch: master
Hash: 0f2c93a25e51bbd41656982ad061307f2c33b32a
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0


Jim
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: PySide migration

Post by wmayer »

ulrich1a wrote:I copied the Pyside addition to the libpack into the existing Libpack for Windows. The compilation was running through. But at starting I got: No module named PySide.
The start-Workbench was empty. I had the same effect on Linux. There I had installed the libpyside-dev packages. So the compilation did run. But I got also: No module named Pyside. It got fixed after installing all the pyside packages.

Is this pyside python code not integrated in the Libpack Pyside-addition?

Ulrich
I don't think FreeCAD can find the PySide stuff from the LibPack. If you do "import sys; print sys.path" you won't see any LibPack directory names. So, you have to copy the stuff to FreeCAD's bin or lib directory.

On Linux you actually have nothing to do. If it doesn't work there then something else must be wrong.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: PySide migration

Post by yorik »

Ok I just fixed the translation system of Arch & Draft... Those should start and work normally now.
Post Reply