sibelius wrote: ↑Fri Jan 31, 2020 10:36 am
I think I solved the problem; I followed this link to install PySide2
https://wiki.qt.io/Qt_for_Python and then I went in my python38 latest version and I follow again the procedure i did for python27....
By the way, this is completely unnecessary, and I'm afraid you may leave your system in a strange state.
I started reading this thread under the assumption that you have a running FreeCAD system. Where did you install it from? The Windows package in
Download?
If this is the case, your system should already contain Python 3, and the necessary versions of Qt5 and PySide2. You don't have to manually install them. They are necessary to run the graphical interface so these libraries should already be included. If you externally install another version of Python 3, and another version of Qt5 and PySide2, that may cause collisions at some point in the future that will be difficult to troubleshoot.
So, if you want my opinion, I suggest you remove everything you installed, FreeCAD, Python, PySide, etc. Make sure your system is clean. Then install only FreeCAD, and then try the examples with the Python console included in FreeCAD.
hi everyone.
I don't remember were I download freeCAD 0.19; I think I did from
https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre.
in this version of FreeCAd PySide2 wasn't in.
I have this two version of freeCAd; 0.18 and 0.19.
I realize that I need PySide to convert files ui into files py.
also I read that PySide war override by PySide2, so basically what I did was to install PySide2 for my python3.6.8 witch is the version I have on my freeCAD 0.19.
after that I created a file batch witch allowed me to give a simple line command to do the conversion (it's not necessary, just easy).
at this point I can convert any file I like just give this command and have as a result a py file compatible with the version of the python running in my freeCAD 0.19.
as above before getting to that I repeat the entire procedure for python2.7 (even if I don't have any FreeCAD running under that Python version, I just try to see where I was landing; at this point my goal was to understaind how to install PySide--also at this point I didn't realize that PySyde was obsolete). anyway I was able to install PySide for Python2.7 and then in the same way I created my file batch to convert from ui to py.
now after installing PYSide for Python2.7 I realize that I was running freeCAD 0.19 under Python 3.6.8 and my thought was: the py file I get is a py done by Python2.7 by PySide (the obsolete version, not the PySide2) and the code inside this py was a Python 2 and not Python 3 (at this point I'm still writing without knowledge among the difference between the two Python versions) and in consequence of that I repeat this entire procedure installing the PySide2 as I explained at the beginning of the message.
Code: Select all
@"C:\Python27\python" "C:\Python27\Lib\site-packages\PySide\scripts\uic.py" %1.ui > %1.py
this is the file batch to run PySide (useless in my case)
Code: Select all
@"C:\Python36\python" "C:\Python36\scripts\pyside2-uic.exe" %1.ui > %1.py
this is the file batch to run PySide2 (that's what I use); finally to operate the conversion you can use one of the following command line
or
Code: Select all
pyside2-uic myfilename.ui > myfilename.py
now at this point I have to understaind a bit of Python3 coding because as Mario52 pointed out in his example there are changes between Pythons versions.
anyway time permitting I'm still learning.
thank you very much for your help
I was just trying to put this two code in freeCAD Python consolle and both seems working ; the second one tell me to exit as well.