Porting to python3

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
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Porting to python3

Post by ebrahim raeyat »

as i mentioned i remove the local library and in miniconda i installed dependency with conda, but it crashed.

in my old manjaro with conda installation it work perfectly:
manjaro17.png
manjaro17.png (33.63 KiB) Viewed 1436 times
but AppImage still crashes. I will examin it in my new ubuntu!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

I see. Therefore you still get a crash when using only FreeCAD and pandas from Conda, and after you removed pandas installed from pip. Well this i guess does indicate some additional issue is involved. Maybe related to system. We can explore this further, but i don't know how much time i will have before next week. Maybe @looo could share the exact procedure he uses for installing FreeCAD and pandas from Conda. Likely not, but maybe there is a difference there.

P.S. Note that i installed your civil module yesterday, and today i noticed it will crash FreeCAD installed from PPA on FreeCAD start (Ubuntu 16.04). But this is likely entirely different issue. Not related to pandas.
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Porting to python3

Post by ebrahim raeyat »

triplus wrote: Wed Dec 12, 2018 2:26 pm
P.S. Note that i installed your civil module yesterday, and today i noticed it will crash FreeCAD installed from PPA on FreeCAD start (Ubuntu 16.04). But this is likely entirely different issue. Not related to pandas.
I test it on ubuntu and it works perfectly. my system:

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.5235 (Git shallow)
Build type: Release
Branch: master
Hash: 0811f1d7844b82dff77c6b4b0ae92ea419b836da
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

pandas's path file:
'/home/ebi/miniconda2/envs/freecad_py3/lib/python3.6/site-packages/pandas/__init__.py'
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Porting to python3

Post by ebrahim raeyat »

I found that error related to openpyxl module when using with PyQt. in FreeCAD this command produce same problem and crash the FreeCAD:

Code: Select all

import openpyxl
but in python that comes with Freecad conda in interactive mode (without FreeCAD running) it works perfectly:

Code: Select all

[ebi@ebrahim-pc bin]$ ./python
Python 3.6.7 | packaged by conda-forge | (default, Nov 21 2018, 02:32:25) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openpyxl
>>> import pandas
>>> openpyxl.__file__
'/home/ebi/Applications/squashfs-root/usr/lib/python3.6/site-packages/openpyxl/__init__.py'
>>> pandas.__file__
'/home/ebi/Applications/squashfs-root/usr/lib/python3.6/site-packages/pandas/__init__.py'
>>> df = pandas.DataFrame()
>>> df.to_excel('/home/ebi/3.xlsx')
>>> 
i found this stackoverflow post that says it's related to libz:

https://stackoverflow.com/questions/263 ... -and-pyqt4

It seems it's not related to FreeCAD!! i must resolve that. thanks you so much.
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Porting to python3

Post by ebrahim raeyat »

ebrahim raeyat wrote: Wed Dec 12, 2018 7:26 pm It seems it's not related to FreeCAD!! i must resolve that. thanks you so much.
but in interactive python it works even with importing QtGui:

Code: Select all

[ebi@ebrahim-pc bin]$ ./python
Python 3.6.7 | packaged by conda-forge | (default, Nov 21 2018, 02:32:25) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide2 import QtGui
>>> import openpyxl
>>> import pandas
>>> QtGui.__file__
'/home/ebi/Applications/squashfs-root/usr/lib/python3.6/site-packages/PySide2/QtGui.cpython-36m-x86_64-linux-gnu.so'
>>> df = pandas.DataFrame()
>>> df.to_excel('/home/ebi/6.xlsx')
>>> 
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

maybe expat is the reason. I guess the manjaro-problem is hard to solve, and not worth trying to as too much hours will be lost. I guess this is a general problem of linux. It's hard to find a way packages run on every distro. Conda does it's best, but some distros will have problem.

I guess there are 2 things which makes conda-builds work more reliable on any system:

- going to gcc7-based builds. There we are able to define linked system-packages by a defined layer which is called cdt (Core Dependency Tree). These packages are repackaged centos-6 libraries. Also the build-environment seems to be more solid as it doesn't sit on top of the system. At least I get the impression of this, as building packages is a bit more difficult now... But I guess the result will be more reliable packages.
- not using too "uptodate" distros. I guess this is a general problem new-comers are often not aware of. (It was the same for me. When you begin to dive into the linux world you want to have all the latest stuff. But once you have dived in enough all you want is stability. eg.: python3, qt5) ;)
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

I likely won't have time to come back to this before Sunday/Monday. After i can read the discussion again and do some tests.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Porting to python3

Post by bernd »

Just encountered a problem on Windows 7 I never had on Windows 10 and on Linux. I do not know it this has reported before ...

- Start FreeCAD, everything looks good Screen1
- make a new Document, FreeCAD gui (icons and menue bar) look strange and is not usable Screen2
- close the docment, wait some seconds, FreeCAD goes back to looking good Screen1

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15468 (Git)
Build type: Release
Branch: master
Hash: 4c67a5c3c66e0796be9884df65655ea679f31919
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)


screen1.png
screen1.png (166.07 KiB) Viewed 1263 times

screen2.png
screen2.png (229.88 KiB) Viewed 1263 times
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Porting to python3

Post by Syres »

Using :

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15468 (Git)
Build type: Release
Branch: master
Hash: 4c67a5c3c66e0796be9884df65655ea679f31919
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

I've tried a variety of Start Preference changes to try to replicate your report and I've failed miserably to do so. I've used FreeCAD with Windows 7 64 bit for 18 months (regularly keeping FreeCAD up-to-date) and never had the icons/toolbars behaving like that. I use a ASUS i7 motherboard with 24Gb ram and a NVIDIA GeForce GTX 670 graphics card (driver version 396.38) if that's of any use.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Porting to python3

Post by chrisb »

Perhaps it's time again to reset the preferences.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply