Porting to python3
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Porting to python3
For your information: PySide2/ pyqt5 wheels from pypi include qt. So theoretically it should be possible to use them in freecad but I don't know if everything we need is included. For conda qt5 and PySide2 are separated packages.
Re: Porting to python3
I used the pip wheel install option when testing for availability of some methods. Available in PySide but got removed and after issue report got reintroduced in PySide2. I didn't do any tests but did wonder if things like header files are provided. And on how to persuade FreeCAD to find everything it needs when compiling. Quick look indicated things like header files are not available. But i didn't look in depth.
P.S. Waiting to test some delta updates:
- kkremitzki
- Veteran
- Posts: 2515
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Porting to python3
A bit ahead of schedule, PySide 2 was uploaded to the Debian NEW queue and approved by the FTP masters today. Things are accelerating for Python 3 support...
https://tracker.debian.org/pkg/pyside2
https://tracker.debian.org/pkg/pyside2
Re: Porting to python3
I was wondering which company could fund this, I should have known! They already funded early development of TechDraw when Ian was working on it. They also contribute to Yorik's Patreon. They use Debian on their computers, so yeah, they're interested in FreeCAD's continued availability in Debian.kkremitzki wrote: ↑Thu Jul 26, 2018 10:19 pm Indeed, hopefully it's OK to say that again we have Aleph Objects to thank and that if anyone reading this is considering a 3D printer purchase in the US, to consider a LulzBot!
I sure wish more companies (apart from the well-known big software companies) were as committed to open source as Aleph Objects are. And I think it's perfectly OK to thank them and to advertise their awesome 3D printers now and then!
Full disclosure: back in December 2012/January 2013, I helped them convert SketchUp files of their TK-0 prototype (which became the TAZ v1.0) into FreeCAD files (I remodelled the parts from scratch actually). I would have been happy with mere thanks and maybe a t-shirt... Jeff Moe (the founder) gave me an AO-100!
Re: Porting to python3
True, I didn't think about headers. Maybe there will be a qt-package from pypi available in the future. I guess conda and pypi will merge at some point into one project. There are some efforts to make pypi packages install-able with conda directly and pypi with wheels theoretically is able to replace conda...triplus wrote:I didn't do any tests but did wonder if things like header files are provided. And on how to persuade FreeCAD to find everything it needs when compiling.
good news!kkremitzki wrote:A bit ahead of schedule, PySide 2 was uploaded to the Debian NEW queue and approved by the FTP masters today. Things are accelerating for Python 3 support...
Re: Porting to python3
Code: Select all
pip3 install PySide2
Re: Porting to python3
That is true but the qt-headers are missing.ian.rees wrote:does install a bunch of PySide2 and Shiboken2 headers.
Re: Porting to python3
Good to hear Py3 and PySide2 efforts are advancing on the Debian front. Likely once we get over this obstacle things will settle a bit again. Conda effort in addition will likely provide an opportunity to be more on the "rolling" side of things (including the Conda based AppImage option). Note that there was a glitch involved. When it comes to zsync filename and url information and AppImage delta updates. When i tested a few days back there was no data to test the whole update procedure and as after @looo provided an updated FreeCAD Conda package. This exposed some issues that should be fixed now.
https://forum.freecadweb.org/viewtopic. ... 18#p247818
All in all it i guess comes down to a few MB of data on a daily basis (when no big package included in the AppImage gets updated).
P.S. I guess not that bad at all!
https://forum.freecadweb.org/viewtopic. ... 18#p247818
All in all it i guess comes down to a few MB of data on a daily basis (when no big package included in the AppImage gets updated).
P.S. I guess not that bad at all!
Re: Porting to python3
I get a single Python syntax error.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14315 (Git)
Build type: Release
Branch: master
Hash: 5f8f26824486b55b2bf72c579e95f0f6d4a19284
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
Test build here (Download Link): https://github.com/FreeCAD/FreeCAD/rele ... 015_x64.7z
Code: Select all
Traceback (most recent call last):
File "C:\Users\Chris\Downloads\conda-win-py3-qt5-x64\bin\lib\unittest\case.py", line 59, in testPartExecutor
yield
File "C:\Users\Chris\Downloads\conda-win-py3-qt5-x64\bin\lib\unittest\case.py", line 605, in run
testMethod()
File "C:\Users\Chris\Downloads\conda-win-py3-qt5-x64\Mod\Test\TestPythonSyntax.py", line 44, in testAll
test_python_syntax(mod_dir, self.whitelist)
File "C:\Users\Chris\Downloads\conda-win-py3-qt5-x64\Mod\Test\TestPythonSyntax.py", line 19, in test_python_syntax
ast.parse(py_file.read())
File "C:\Users\Chris\Downloads\conda-win-py3-qt5-x64\bin\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 30760: character maps to <undefined>
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14315 (Git)
Build type: Release
Branch: master
Hash: 5f8f26824486b55b2bf72c579e95f0f6d4a19284
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
Test build here (Download Link): https://github.com/FreeCAD/FreeCAD/rele ... 015_x64.7z
"fight the good fight"
Re: Porting to python3
Have some issue after latest update of python (3.6 > 3.7) on my Arch-Linux machine.
make error log:
Current python implementation call `_PyImport_FixupBuiltin` which is an interal function, correct way of handling this could be found in gdb bugtracker https://sourceware.org/bugzilla/show_bug.cgi?id=23252
Code: Select all
42 cmake -DCMAKE_BUILD_TYPE=Release \
43 -DCMAKE_INSTALL_PREFIX="/opt/${_appname}" \
44 -DFREECAD_USE_OCC_VARIANT="Community Edition" \
45 -DPYTHON_EXECUTABLE="/usr/bin/python3" \
46 -DBUILD_QT5=ON
47 make
Code: Select all
[ 32%] Built target StdMeshers
/home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.cpp: In constructor ‘App::Application::Application(std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&)’:
/home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.cpp:233:49: error: too few arguments to function ‘int _PyImport_FixupBuiltin(PyObject*, const char*, PyObject*)’
_PyImport_FixupBuiltin(pAppModule, "FreeCAD");
^
In file included from /usr/include/python3.7m/Python.h:126,
from /home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/Base/PyObjectBase.h:38,
from /home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.h:32,
from /home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.cpp:56:
/usr/include/python3.7m/import.h:115:17: note: declared here
PyAPI_FUNC(int) _PyImport_FixupBuiltin(
^~~~~~~~~~~~~~~~~~~~~~
/home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.cpp:274:58: error: too few arguments to function ‘int _PyImport_FixupBuiltin(PyObject*, const char*, PyObject*)’
_PyImport_FixupBuiltin(pBaseModule, "__FreeCADBase__");
^
In file included from /usr/include/python3.7m/Python.h:126,
from /home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/Base/PyObjectBase.h:38,
from /home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.h:32,
from /home/bartus/.cache/aursync/freecad-python3-git/src/freecad-python3/src/App/Application.cpp:56:
/usr/include/python3.7m/import.h:115:17: note: declared here
PyAPI_FUNC(int) _PyImport_FixupBuiltin(
^~~~~~~~~~~~~~~~~~~~~~