appimage

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
NormandC
Posts: 17791
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: appimage

Postby NormandC » Mon Jan 21, 2019 12:45 am

No issue with icons/freecad-daily on Ubuntu 18.04.

Are you using a (system-wide) custom icon pack in Ubuntu?

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15611 (Git)
Build type: Release
Branch: master
Hash: 64a94ae0f7c60fc981086fe157150a9c0dca29c6
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Canada (fr_CA)
User avatar
fosselius
Posts: 267
Joined: Sat Apr 23, 2016 10:03 am

Re: appimage

Postby fosselius » Mon Jan 21, 2019 5:30 am

Its a clean ubuntu 18.10 slim dektop install. Only freecad and buildtools/dep installed.
rentlau_64
Posts: 179
Joined: Tue Oct 21, 2014 9:47 am
Location: Pau (France)

Re: appimage

Postby rentlau_64 » Thu Jan 24, 2019 6:33 am

hello every body,
I download these rekease in order to start testing Work Feature Wb an Macro under python 3.

I download:
FreeCAD_0.18.15650.glibc2.17-x86_64.AppImage
but no python 3
OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15650 (Git) AppImage
Build type: Release
Branch: master
Hash: c9b4f4ba6779c9ccddb69fba57eee1b5acfd4083
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
Then I download :
FreeCAD_0.18.15671_Conda_Py3Qt5_glibc2.12-x86_64.AppImage
but i have an error message:

Code: Select all

./FreeCAD_0.18.15671_Conda_Py3Qt5_glibc2.12-x86_64.AppImage
/tmp/.mount_FreeCA4mJ2VX
FreeCAD 0.18, Libs: 0.18R15671 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Gtk-Message: 06:31:47.140: Failed to load module "canberra-gtk-module"
During initialization the error /tmp/.mount_FreeCA4mJ2VX/usr/bin/../lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/laurent/.local/lib/python3.6/site-packages/PySide2/QtCore.abi3.so) occurred in /tmp/.mount_FreeCA4mJ2VX/usr/Mod/Arch/InitGui.py
Please look into the log file for further information
During initialization the error /tmp/.mount_FreeCA4mJ2VX/usr/bin/../lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/laurent/.local/lib/python3.6/site-packages/PySide2/QtCore.abi3.so) occurred in /tmp/.mount_FreeCA4mJ2VX/usr/Mod/Draft/InitGui.py
Please look into the log file for further information
During initialization the error /tmp/.mount_FreeCA4mJ2VX/usr/bin/../lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/laurent/.local/lib/python3.6/site-packages/PySide2/QtCore.abi3.so) occurred in /tmp/.mount_FreeCA4mJ2VX/usr/Mod/Tux/InitGui.py
Please look into the log file for further information
During initialization the error invalid syntax (<string>, line 63) occurred in /home/laurent/.FreeCAD/Mod/FreeCAD_WF_Parametric/InitGui.py
Please look into the log file for further information
During initialization the error /tmp/.mount_FreeCA4mJ2VX/usr/bin/../lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/laurent/.local/lib/python3.6/site-packages/PySide2/QtCore.abi3.so) occurred in freecad.pip
--------------------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 145, in InitApplications
  File "/tmp/.mount_FreeCA4mJ2VX/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/tmp/.mount_FreeCA4mJ2VX/usr/lib/python3.6/site-packages/freecad/pip/init_gui.py", line 2, in <module>
    from PySide import QtCore, QtGui
  File "/tmp/.mount_FreeCA4mJ2VX/usr/Ext/PySide/QtCore.py", line 1, in <module>
    from PySide2.QtCore import *
ImportError: /tmp/.mount_FreeCA4mJ2VX/usr/bin/../lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/laurent/.local/lib/python3.6/site-packages/PySide2/QtCore.abi3.so)
--------------------------------------------------------------------------------
any help will be useful
thank you very much
Rentlau
looo
Posts: 2234
Joined: Mon Nov 11, 2013 5:29 pm

Re: appimage

Postby looo » Thu Jan 24, 2019 7:09 am

Your local version of pyside2 is prefered and not compatible with pyside2 of the appimage. Better not install pyside2 locally via pip. Maybe it's possible for you to uninstall the local pyside2.
User avatar
fosselius
Posts: 267
Joined: Sat Apr 23, 2016 10:03 am

Re: appimage

Postby fosselius » Thu Jan 24, 2019 7:28 am

looo wrote:
Thu Jan 24, 2019 7:09 am
Better not install pyside2 locally via pip. Maybe it's possible for you to uninstall the local pyside2.
Surely there has to be a better way? Is it not possible to force the appimg to use its own version? Thought that was kind of the entire point with app img and simular containers.
looo
Posts: 2234
Joined: Mon Nov 11, 2013 5:29 pm

Re: appimage

Postby looo » Thu Jan 24, 2019 9:11 am

fosselius wrote:
Thu Jan 24, 2019 7:28 am
Surely there has to be a better way? Is it not possible to force the appimg to use its own version? Thought that was kind of the entire point with app img and simular containers.
python allows to use a -s argument which disables user-side-packages. Maybe it's possible to add this option to FreeCAD? The best option would be a switch in the config of freecad to enable/disable ~/.local/lib/pythonx.y.
User avatar
fosselius
Posts: 267
Joined: Sat Apr 23, 2016 10:03 am

Re: appimage

Postby fosselius » Thu Jan 24, 2019 10:45 am

I am no appimg expert and have not seen the actual freecad app img creation script, but this looks helpful:
https://github.com/AppImage/AppImageKit ... ython-apps

Especially: "it is advised that you use workingenv.py, a script that sets up an isolated environment into which you can install your Python app and its dependencies that are not part of the standard library."

But that might be what is done already and some smart config still decides that the system lib is better..
looo
Posts: 2234
Joined: Mon Nov 11, 2013 5:29 pm

Re: appimage

Postby looo » Thu Jan 24, 2019 11:49 am

In your case it's not a system lib that makes problems. It's a package installed for the user in home-directory. Packages installed this way are also available for different virtual envs and it's more by design this is like it is.

My suggestion is to not install any difficult packages in home directory.
User avatar
fosselius
Posts: 267
Joined: Sat Apr 23, 2016 10:03 am

Re: appimage

Postby fosselius » Thu Jan 24, 2019 1:18 pm

This might be helpful:
http://matthew-brett.github.io/pydagogu ... ebian.html

"The --user flag to pip install tells Pip to install packages in some specific directories within your home directory. This is a good way to have your own default Python environment that adds to the packages within your system directories, and therefore, does not affect the system Python installation.

So, if you install a package like this:

Code: Select all

pip install --user mypackage
"
looo
Posts: 2234
Joined: Mon Nov 11, 2013 5:29 pm

Re: appimage

Postby looo » Thu Jan 24, 2019 2:35 pm

some tests:

fresh python3.7 environment:

Code: Select all

>>> import sys
>>> sys.path
['', '/home/lo/conda/envs/python37/lib/python37.zip', '/home/lo/conda/envs/python37/lib/python3.7', '/home/lo/conda/envs/python37/lib/python3.7/lib-dynload', '/home/lo/conda/envs/python37/lib/python3.7/site-packages']
install a package with pip:

Code: Select all

pip install six
sys.path stays the same:

Code: Select all

>>> import sys
>>> sys.path
['', '/home/lo/conda/envs/python37/lib/python37.zip', '/home/lo/conda/envs/python37/lib/python3.7', '/home/lo/conda/envs/python37/lib/python3.7/lib-dynload', '/home/lo/conda/envs/python37/lib/python3.7/site-packages']
>>> 
now install six for the user:

Code: Select all

pip uninstall six
pip install --user
printing the path again:

Code: Select all

>>> import sys
>>> sys.path
['', '/home/lo/conda/envs/python37/lib/python37.zip', '/home/lo/conda/envs/python37/lib/python3.7', '/home/lo/conda/envs/python37/lib/python3.7/lib-dynload', '/home/lo/.local/lib/python3.7/site-packages', '/home/lo/conda/envs/python37/lib/python3.7/site-packages']
Now the user-side-packages-dir is added.

For the app-image we do not install any packages with pip and the --user flag. But I used it for the pip-integration-tool. So maybe you installed any library with this tool? Or the appimage does some magic and adds this directory to sys.path?

I always assumed that the user-side-packages are also available to virtual-envs. But you are right and it makes sense if this is not the case.

For the pip-integration-tool I need to find another solution. I guess a special --user-dir would be nice to have. Maybe something like "~/.FreeCAD/pythonx.y/lib/site-packages". This would be nice, but I never found a way to manually set the user-side-packages-dir.