I have noticed a strange behavior of the xtb energy calculators in Linux. Namely, the performance of the plugin depends on the python environment of the shell where the code is launched (with the same python path in the Python Settings widget). When I run Avogadro2 from a terminal with Python 3.10.12, the plugin does not work, with the following message (repeated over and over in the terminal):
QIODevice::write (QProcess): device not open
The optimizer does not change the structure, while the dynamics move the atoms randomly (likely due to the thermostat), destroying the structure.
Instead, when I activate a conda environment with Python 3.11.7, the plugin works correctly. Related to the issue Molecular distortion during xtb optimization in Nightly 1.103.0 , in this latter case, the optimization runs smoothly. I tried benzene, and got the right planar structure after optimization.
We strongly recommend using pixi for managing plugins. It will install a virtual environment for each plugin with an appropriate version of Python.
If you’re switching python environments .. I have no idea what would happen. The xtb-energy plugin requires the xtb-python package to operate. Do you have that installed in both environments?
I installed pixi outside the conda environment, and the QIODevice::write (QProcess): device not open warning disappeared. However, the core issue remains: the xtb energy does not seem to be computed correctly (it is either not set or effectively zero), and running Dynamics leads to the molecule breaking apart.
I then attempted to reinstall the plugin, but this made things worse. At this point, it is no longer working even within the conda environment where it previously did.
I am currently investigating the issue further and will report back once I have a clearer understanding of the cause. For completeness, I have also reinstalled xtb-python using conda, but the problem persists.
I would like to add my report regarding the issue mentioned above.
This issue was first observed while using Python 3.12.7 with Anaconda3 on Windows 11. Although switching to Python 3.11.11 initially seemed to resolve the problem, the bug reappeared after I restarted my PC, and now the optimization fails to work correctly on either version.
I have even tried installing previous nightly builds of Avogadro2 that I had downloaded in the past, but the results remain the same, which leads me to believe the issue is related to the Python environment itself. Interestingly, I have tested this across three different computers, and while xTB geometry optimization works perfectly on two of them, the problem is isolated to this specific machine despite all of them running Windows 11 and similar Anaconda setups.