FreeCAD won't start, even appimage after pySide2 install

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
s-light
Posts: 119
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: FreeCAD won't start, even appimage after pySide2 install

Post by s-light »

looo wrote: Mon Apr 19, 2021 6:28 pm you have a local installation of shiboken. This will hide the package within the appimage.
thanks for your help looo!
seems that this was installed as dependency with my

Code: Select all

pip3 install PySide2

but not removed on my uninstall...

now it is working again!!
drmacro
Veteran
Posts: 9000
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by drmacro »

This is extremely frustrating. I'm out of ideas. What does it take to tell FC where sh** is. :x Or, what is messed up so bad on this machine that prevents FC from finding it?

I have completely uninstalled everything in the deps list. Uninstalled everything of python3 and pyside2.

Then reinstalled everything.
Confirmed it's all there, python seems to be running python3. (i.e. the sym links seem to be ok.)

and, with no errors, rebuilt FC.

And when I run FC from the terminal:

Code: Select all

During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Arch/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Tux/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/AddonManager/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Draft/InitGui.py
Please look into the log file for further information
Unknown command 'Std_AddonMgr'
Fatal Python error: could not initialize part 2
Python runtime state: initialized

Current thread 0x00007fe5ff3f6100 (most recent call first):
  File "/usr/lib/python3/dist-packages/six.py", line 128 in __init__
  File "/usr/lib/python3/dist-packages/six.py", line 320 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "/home/mac/freecad-build/Mod/Start/StartPage/StartPage.py", line 27 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1042 in _handle_fromlist
  File "<string>", line 2 in <module>
Aborted (core dumped)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: FreeCAD won't start, even appimage after pySide2 install

Post by Syres »

drmacro wrote: Tue Apr 20, 2021 1:24 pm This is extremely frustrating. I'm out of ideas.
I'm guessing you don't have a Timeshift equivalent on your Linux distro, it really pulled me out of the mire when I messed with something that I didn't understand? If not, then maybe this could be of use https://forum.freecadweb.org/viewtopic.php?f=10&t=55612
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by looo »

s-light wrote: Tue Apr 20, 2021 7:51 am now it is working again!!
nice
drmacro wrote: Tue Apr 20, 2021 1:24 pm This is extremely frustrating. I'm out of ideas. What does it take to tell FC where sh** is. :x Or, what is messed up so bad on this machine that prevents FC from finding it?

I have completely uninstalled everything in the deps list. Uninstalled everything of python3 and pyside2.

Then reinstalled everything.
Confirmed it's all there, python seems to be running python3. (i.e. the sym links seem to be ok.)

and, with no errors, rebuilt FC.

And when I run FC from the terminal:

Code: Select all

During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Arch/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Tux/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/AddonManager/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Draft/InitGui.py
Please look into the log file for further information
Unknown command 'Std_AddonMgr'
Fatal Python error: could not initialize part 2
Python runtime state: initialized

Current thread 0x00007fe5ff3f6100 (most recent call first):
  File "/usr/lib/python3/dist-packages/six.py", line 128 in __init__
  File "/usr/lib/python3/dist-packages/six.py", line 320 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "/home/mac/freecad-build/Mod/Start/StartPage/StartPage.py", line 27 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 783 in exec_module
  File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 991 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1042 in _handle_fromlist
  File "<string>", line 2 in <module>
Aborted (core dumped)
maybe cueck your installed pyside versions with something like this:

Code: Select all

sudo find / -type d -name 'PySide2' 2>/dev/null
I guess you have two incompatible pyside2/qt5 versions installed.
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by user1234 »

On what OS you are? When you are on a Debian based OS, have you installed packages like freecad-python3 and other python packages?

Long time ago i had the issue, that CMake had issues to find the correct python packages, especially when some meta-packages are installed. FreeCAD had compiled, but had also python issues.
Syres wrote: Tue Apr 20, 2021 1:43 pm If not, then maybe this could be of use https://forum.freecadweb.org/viewtopic.php?f=10&t=55612
That is the reason why i only use one package manager. Also for me pip is shadowy (what is where installed).

Greetings
drmacro
Veteran
Posts: 9000
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by drmacro »

user1234 wrote: Tue Apr 20, 2021 2:16 pm On what OS you are? When you are on a Debian based OS, have you installed packages like freecad-python3 and other python packages?

...
I'm discussing this on gitter as well, so I forget what I've said where...

But, this particular PC (Ubuntu 20.04) has been, daily, updating from github, compiling and running FC 0.20 for a couple months.

This is new behavior after attempting to get the uic to python converter for pyside2.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 9000
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by drmacro »

Some progress after reading the link offered by @Syres.

Code: Select all

grep -ri shiboken2 ~/.local

Code: Select all

grep -ri pyside ~/.local
Recommended by the link list a lot...but, wasn't sure how to remove them (Yes, I know the rm command, but...) :roll:

Ran:

Code: Select all

pip uninstall six shiboken2
Now when I start FC, I get this, but the FC GUI does launch:

Code: Select all

During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Arch/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Tux/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/AddonManager/InitGui.py
Please look into the log file for further information
During initialization the error "name '_init_pyside_extension' is not defined" occurred in /home/mac/freecad-build/Mod/Draft/InitGui.py
Please look into the log file for further information
Unknown command 'Std_AddonMgr'
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/home/mac/freecad-build/Mod/Start/StartPage/StartPage.py", line 27, in <module>
    import six
<class 'ModuleNotFoundError'>: No module named 'six'
No module named 'six'
connect failed: No such file or directory
 
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 9000
Joined: Sun Mar 02, 2014 4:35 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by drmacro »

Success! :D

I had to:

uninstall

Code: Select all

pip uninstall PySide2 shiboken2
At this point FC would start but still couldn't find a couple differe UI init files

Code: Select all

During initialization the error "UI file does not exist" occurred in /home/mac/freecad-build/Mod/Arch/InitGui.py
Please look into the log file for further information
During initialization the error "UI file does not exist" occurred in /home/mac/freecad-build/Mod/Draft/InitGui.py
Please look into the log file for further information
(
Then I used apt to reinstall all the prescribed FC deps. And rebuilt FC.

It now appears to be fixed.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: FreeCAD won't start, even appimage after pySide2 install

Post by user1234 »

I am on Debian 11 (testing). So the packages should be similar.

I have only pyside related packages installed:

- libpyside2-dev
- libpyside2-py3-5.15
- libshiboken2-dev
- libshiboken2-py3-5.15
- shiboken2

- pyside2-tools !! (maybe this is missing)
- python3-pyside2.qtcore
- python3-pyside2.qtgui

- python3-pyside2.qtopengl (this is afaik not for FreeCAD)
- python3-pyside2.qtsvg
- python3-pyside2.qtuitools
- python3-pyside2.qtwidgets
- python3-pyside2.qtxml
- python3-pyside2.qtxmlpatterns

Also note, that that cmake recognize the correct setting and folders/files.
01.png
01.png (37.17 KiB) Viewed 873 times
02.png
02.png (16.41 KiB) Viewed 873 times
03.png
03.png (137.16 KiB) Viewed 873 times
Greetings

edit: to late, but i am glad that it works now.
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: FreeCAD won't start, even appimage after pySide2 install

Post by chrisb »

As this was going a bit to and fro: would you mind writing an entry for the Known OS specific issues topic? You can add it here, and I add it to the issues.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply