PyLuxCoreTools - Segmentation Fault

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
d1nuc0m
Posts: 13
Joined: Thu Apr 29, 2021 11:49 am
Location: Italy
Contact:

PyLuxCoreTools - Segmentation Fault

Post by d1nuc0m » Mon May 03, 2021 4:33 pm

I was trying to use PyLuxCoreTools (from 2.5 release) on Kubuntu 20.04.x, with Python 3.8.5.
I extracted the folder and tried to run both python3 pyluxcoretools.zip and sudo python3 pyluxcoretools.zip.
The only result is "Segmentation fault".

User avatar
Dade
Developer
Posts: 5217
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PyLuxCoreTools - Segmentation Fault

Post by Dade » Mon May 03, 2021 6:46 pm

Releases are compiled with Python v3.7 (because of Blender), it is likely to not work with v3.8. I know for sure that opposite: binaries compiled with v3.8 doesn't work with v3.7.
Support LuxCoreRender project with salts and bounties

d1nuc0m
Posts: 13
Joined: Thu Apr 29, 2021 11:49 am
Location: Italy
Contact:

Re: PyLuxCoreTools - Segmentation Fault

Post by d1nuc0m » Wed May 05, 2021 4:17 pm

Dade wrote:
Mon May 03, 2021 6:46 pm
Releases are compiled with Python v3.7 (because of Blender), it is likely to not work with v3.8. I know for sure that opposite: binaries compiled with v3.8 doesn't work with v3.7.
Ok, I have tried to use Python 3.7.10 with pyenv (PySide2 installed), but I still get a segmentation fault.
This happens both with Python 3.7.10 as shell-specific Python version and both with 3.7.10 set as global Python version.

User avatar
Dade
Developer
Posts: 5217
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PyLuxCoreTools - Segmentation Fault

Post by Dade » Wed May 05, 2021 4:44 pm

I assume you have PySide related problem, does "python3 pyluxcoretools.zip help" work ?
Support LuxCoreRender project with salts and bounties

d1nuc0m
Posts: 13
Joined: Thu Apr 29, 2021 11:49 am
Location: Italy
Contact:

Re: PyLuxCoreTools - Segmentation Fault

Post by d1nuc0m » Wed May 05, 2021 6:04 pm

Dade wrote:
Wed May 05, 2021 4:44 pm
I assume you have PySide related problem, does "python3 pyluxcoretools.zip help" work ?
Just tried, it looks like it works, the output is:

Code: Select all

usage: pyluxcoretools.zip [commandToExecute]

PyLuxCoreTool

positional arguments:
  commandToExecute  help, console, merge, netconsole, netconsoleui, netnode or
                    netnodeui
Meanwhile, also tried sudo python3 pyluxcoretools.zip, but still gives segmentation fault.

By the way, I have installed PySide2, as PySide install is not possible on Python 3.7.x (it fails with the following error: only these python versions are supported: [(2, 6), (2, 7), (3, 2), (3, 3), (3, 4)])

User avatar
Dade
Developer
Posts: 5217
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PyLuxCoreTools - Segmentation Fault

Post by Dade » Wed May 05, 2021 7:02 pm

You can use all pyluxcoretools command line functionalities (i.e. pretty much everything). Due to the lack of PySide, you can not use anything requiring a GUI.

"python3 pyluxcoretools.zip" just open a windows with few options: if you are lacking PySide, it should print an error and it does on my Ubuntu. It looks more like you have something messed up with Python (i.e. it is probably trying to run some wrong version of the PySide binaries).
Support LuxCoreRender project with salts and bounties

d1nuc0m
Posts: 13
Joined: Thu Apr 29, 2021 11:49 am
Location: Italy
Contact:

Re: PyLuxCoreTools - Segmentation Fault

Post by d1nuc0m » Wed May 05, 2021 9:40 pm

Dade wrote:
Wed May 05, 2021 7:02 pm
You can use all pyluxcoretools command line functionalities (i.e. pretty much everything). Due to the lack of PySide, you can not use anything requiring a GUI.

"python3 pyluxcoretools.zip" just open a windows with few options: if you are lacking PySide, it should print an error and it does on my Ubuntu. It looks more like you have something messed up with Python (i.e. it is probably trying to run some wrong version of the PySide binaries).
Ok, I also tried on another machine (Artix Linux), this is what I did after installing pyenv:

Code: Select all

$ pyenv shell 3.7.10

# Check if I'm using the correct tools
$ python3 --version
Python 3.7.10
$ pip --version
pip 20.1.1 from /home/user/.pyenv/versions/3.7.10/lib/python3.7/site-packages/pip (python 3.7)

# Running PyLuxCore
$ python3 pyluxcoretools.zip
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
Traceback (most recent call last):
  File "pyluxcoretools.zip/pyluxcoretools/pyluxcoremenu/cmd.py", line 25, in <module>
    
ModuleNotFoundError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.pyenv/versions/3.7.10/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/user/.pyenv/versions/3.7.10/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "pyluxcoretools.zip/__main__.py", line 73, in <module>
  File "pyluxcoretools.zip/pyluxcoretools/pyluxcoremenu/cmd.py", line 30, in <module>
    commands that have no complete_ method.
ModuleNotFoundError: No module named 'PySide2'

# Installing required modules
$ pip install PySide2 numpy
(...)
Successfully installed PySide2-5.15.2 numpy-1.20.2 shiboken2-5.15.2

#PyLuxCoreTools
$ python3 pyluxcoretools.zip
QApplication: invalid style override 'gtk2' passed, ignoring it.
        Available styles: Windows, Fusion
Segmentation fault

$ sudo python3 pyluxcoretools.zip
Segmentation fault
What I have not understood is, in theory should I use PySide or PySide2? Because using PySide on Python 3.7.x is not possible. :?
The highest Python version supported by PySide is 3.4.x, EOL as of 2019, and PySide itself requires Qt 4.x, EOL as of 2015 (trying to use 3.4.10 with PySide has turned into a mess of unmet dependencies and software removed from repos because obsolete).

There is a port of PySide to Qt 5.x, but PyLuxcoreTools seem not to recognise it (tried in another environment):

Code: Select all

$ pyenv shell 3.7.10
$ pip install pyside6 numpy
(...)
Successfully installed pyside6-6.0.4 shiboken6-6.0.4
$ python3 pyluxcoretools.zip
Traceback (most recent call last):
  File "pyluxcoretools.zip/pyluxcoretools/pyluxcoremenu/cmd.py", line 25, in <module>
    
ModuleNotFoundError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.pyenv/versions/3.7.10/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/user/.pyenv/versions/3.7.10/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "pyluxcoretools.zip/__main__.py", line 73, in <module>
  File "pyluxcoretools.zip/pyluxcoretools/pyluxcoremenu/cmd.py", line 30, in <module>
    commands that have no complete_ method.
ModuleNotFoundError: No module named 'PySide2'
I would advice dropping PySide definitely in favor of PySide2 or PySide6

User avatar
Dade
Developer
Posts: 5217
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PyLuxCoreTools - Segmentation Fault

Post by Dade » Wed May 05, 2021 10:58 pm

Code: Select all

ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
It looks like you are missing numpy too.

The code was written first for PySide than we moved to PySide2. I don't remember if it is still compatible with old PySide(1), it was for some time (we supported both).

Short version: use PySide2.
Support LuxCoreRender project with salts and bounties

d1nuc0m
Posts: 13
Joined: Thu Apr 29, 2021 11:49 am
Location: Italy
Contact:

Re: PyLuxCoreTools - Segmentation Fault

Post by d1nuc0m » Thu May 06, 2021 9:24 am

Dade wrote:
Wed May 05, 2021 10:58 pm

Code: Select all

ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
It looks like you are missing numpy too.

The code was written first for PySide than we moved to PySide2. I don't remember if it is still compatible with old PySide(1), it was for some time (we supported both).

Short version: use PySide2.
Yes, if you scroll down, I then installed numpy & PySide2, then it gives segmentation fault:

Code: Select all

$ pip install PySide2 numpy
(...)
Successfully installed PySide2-5.15.2 numpy-1.20.2 shiboken2-5.15.2

$ python3 pyluxcoretools.zip
QApplication: invalid style override 'gtk2' passed, ignoring it.
        Available styles: Windows, Fusion
Segmentation fault

$ sudo python3 pyluxcoretools.zip
Segmentation fault
I was asking about PySide(1) because as you can see there also was an error related to missing PySide(1)

Code: Select all

Traceback (most recent call last):
  File "pyluxcoretools.zip/pyluxcoretools/pyluxcoremenu/cmd.py", line 25, in <module>
    
ModuleNotFoundError: No module named 'PySide'

User avatar
Dade
Developer
Posts: 5217
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PyLuxCoreTools - Segmentation Fault

Post by Dade » Thu May 06, 2021 10:10 am

Like I wrote before, you can try to track a stack trace with gdb but, by definition, a Python application can not throw a segmentation fault so you have something broken in your installation.
Support LuxCoreRender project with salts and bounties

Post Reply