Menu

#393 [2.0.10 - beta] Can't use Python as scripting language

next
open
nobody
4normal
2020-05-26
2020-03-24
Fellype
No

Python can't be selected as scripting language in SciDAVis 2.0.10 - beta, built from source
(build environment: Slackware-current (64 bits), Python 3.8.2, GCC 9.3.0, Qt 5.13.2, classdesc 3.38)

  • Clicking Scripting menu -> Scripting language -> Python leads to error shown in Fig. Python_load_bug-01.png when clicking Python and to error shown in Fig. Python_load_bug-02.png when clicking OK button. Command line output shows:
<frozen importlib._bootstrap>:219: RuntimeWarning: to-Python converter for QString already registered; second conversion method ignored.
<frozen importlib._bootstrap>:219: RuntimeWarning: to-Python converter for classdesc::python_t::Scope::PythonDummy already registered; second conversion method ignored.
  • Defining Python as default scripting language also doesn't work and also doesn't start again if preferences are saved. Command line output (after saving preferences) gives:
bash-5.0$ ./scidavis 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-zeh'
defining module scidavis
<frozen importlib._bootstrap>:219: RuntimeWarning: to-Python converter for QString already registered; second conversion method ignored.
<frozen importlib._bootstrap>:219: RuntimeWarning: to-Python converter for classdesc::python_t::Scope::PythonDummy already registered; second conversion method ignored.
terminate called after throwing an instance of 'boost::python::error_already_set'
Aborted
bash-5.0$

Trying to run in debug mode, debug symbols look to not exist:

bash-5.0$ gdb ./scidavis 
GNU gdb (GDB) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-slackware-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./scidavis...
(No debugging symbols found in ./scidavis)
(gdb) run
Starting program: /home/fellype/z-tmp-built/package-scidavis/usr/bin/scidavis 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff1e0f700 (LWP 21349)]
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-zeh'
[New Thread 0x7ffff1400700 (LWP 21350)]
[New Thread 0x7ffff0afb700 (LWP 21351)]
[New Thread 0x7fffdee9b700 (LWP 21355)]
[New Thread 0x7fffde69a700 (LWP 21356)]
[New Thread 0x7fffdde99700 (LWP 21357)]
[New Thread 0x7fffdd698700 (LWP 21358)]
defining module scidavis
<frozen importlib._bootstrap>:219: RuntimeWarning: to-Python converter for QString already registered; second conversion method ignored.
<frozen importlib._bootstrap>:219: RuntimeWarning: to-Python converter for classdesc::python_t::Scope::PythonDummy already registered; second conversion method ignored.
[Thread 0x7ffff0afb700 (LWP 21351) exited]
[Thread 0x7ffff1e0f700 (LWP 21349) exited]
[Thread 0x7fffdd698700 (LWP 21358) exited]
[Thread 0x7fffde69a700 (LWP 21356) exited]
[Thread 0x7fffdee9b700 (LWP 21355) exited]
[Thread 0x7fffdde99700 (LWP 21357) exited]
[Thread 0x7ffff1400700 (LWP 21350) exited]
[Inferior 1 (process 21342) exited normally]
(gdb)
2 Attachments

Discussion

  • High Performance Coder

    You've reported two bugs here. One cannot switch to Python scripting in the GUI, due to some Qt error (I don't know what the message means exactly). The second issue is that setting the scripting language to Python in preferences causes scidavis to immediately exit on startup. That will be easier to debug.

    You can run python scripts from the command line via the -x flag, prvided the default scripting language is set to muparser.

     
  • High Performance Coder

    Well I have solved the problem with switching to python scripting mode. Unfortunately, I still can't run anything yet, even something as simple as "print("hello")".

     
  • Fellype

    Fellype - 2020-03-26

    Just a comment,

    Python is working fine in SciDAVis 1.26 - built from source; environment: Slackware-current (64 bits), Python 3.8.2, GCC 9.3.0, Qt 5.13.2, PyQt 5.13.2

     
  • gbm

    gbm - 2020-05-25

    Attached patch, applied to classdesc-python branch, commit b6e3012f, may solve the problem.

     
  • High Performance Coder

    Hi Miquel, thanks for looking at this. Just a little request to assign the ownership of the ticket to yourself when you work on something to prevent duplicate efforts. As it was, my attentions are elsewhere (such as getting the Windows/Mac 2.x release builds out), so nothing was duplicated, but I'm severely constrained by lack of time (I've got a two month crunch ahead of me).

     

Log in to post a comment.