GaussSum 3.0 apt-get Install simpledialog Fix In Ubuntu 24.04 (Others)

Above: Just needed an output from GaussSum for show-and-tell. This image from the article "Computational Study of Benzothiazole Derivatives for Conformational, Thermodynamic and Spectroscopic Features and Their Potential to Act as Antibacterials," available at https://www.mdpi.com/2073-4352/12/7/912.

Continuing on the Ubuntu 24.04(.1) migration theme and in the thick of needing a program to simply prepare partial Density-of-States (that link, but in this case for molecular systems) analyses, users might find themselves working through the python3, numpy, gnuplot, cclib, python3-tk installation process on the old GaussSum Installing on Linux page without knowing that gausssum 3.0 has been available as a stand-alone apt-get for several recent Ubuntu versions.

apt-get GaussSum (3.0) after 502 MB of installs and one line change to preferencesbox.py

That, minus the amount of dependencies that get installed to make the program happen, is the good news.

First attempting to run gausssum from a terminal after this apt-get install produces the following:

user@machine:~$ gausssum 
Traceback (most recent call last):
  File "/usr/bin/gausssum", line 23, in <module>
    import gausssum.gausssumgui
  File "/usr/lib/python3/dist-packages/gausssum/gausssumgui.py", line 27, in <module>
    from gausssum.preferencesbox import PreferencesPopupBox
  File "/usr/lib/python3/dist-packages/gausssum/preferencesbox.py", line 21, in <module>
    class PreferencesPopupBox(simpledialog.Dialog):
                              ^^^^^^^^^^^^
NameError: name 'simpledialog' is not defined

As much as https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter looks like an answer to the problem, the solution is a simple change at the very top of preferencesbox.py that can be found in https://stackoverflow.com/questions/9570550/pythons-tkinter-simpledialog-askstring-not-working-from-command-prompt (I didn't bother to ask ChatGPT just to help keep the SO traffic up). Use your editor of choice:

sudo nano /usr/lib/python3/dist-packages/gausssum/preferencesbox.py

and make the following change to line 17:

import tkinter.simpledialog as simpledialog

After that, type gausssum, click on Help > About, and you should see the above, minus the previous NE-1 install in the background from the last post.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.