# Xtb plugin installation

**URL:** <https://discuss.avogadro.cc/t/xtb-plugin-installation/6340>\
**Category:** Support\
**Created:** [October 2, 2024, 6:28pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340 "2024-10-02T18:28:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 2, 2024, 6:28pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/1 "2024-10-02T18:28:09Z")

</div>

I believe this to be a problem with installing the xtb plugin for Avogadro

## Environment Information

Avogadro version: 1.99.0  
Operating system and version: Windows 10 Enterprise, version 22H2

## Expected Behavior

According to the plugin manual, as one of the five ways of installation:

_Manually download `xtb` and place it entirely within the `Avogadro/commands/avo_xtb/` directory_

## Actual Behavior

There is no /commands directory in my Avogadro2 installation

## Steps to Reproduce

Please upload files if appropriate here (or via file-sharing service like Dropbox or Pastebin)

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/d/db86ea21dda9be72af4567e5e90f03bc29093710.png)

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 3, 2024, 2:13pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/2 "2024-10-03T14:13:04Z")

</div>

Hi,

If you’ve installed the plugin from the dialog in Avogadro then it will have definitely been downloaded to that folder. But the plugins folder is not located at the path you’ve shown, it’s at `%USERPROFILE%\AppData\Local\Avogadro` or `%USERPROFILE%\AppData\Roaming\Avogadro` (I forget which of the two).

Sorry that that wasn’t clear, I’ve updated the README with a link to the docs that tell you where the folder is located.

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 3, 2024, 6:35pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/3 "2024-10-03T18:35:08Z")

</div>

Thanks a lot, Matt!  
I did not realise that the standard plugin upload menu in Avogadro2 contains your plugin, now having used this standard dialog, I found the plugin in:  
…\AppData\Local\OpenChemistry\Avogadro\commands\avo\_xtb  
However, the plugin existence is not yet seen in any of the Avogadro2 menus I try, such as Extensions. I imagine, now I need to download and install the xtb package itself from its own GitHub repository - is that correct?  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 3, 2024, 8:20pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/4 "2024-10-03T20:20:40Z")

</div>

Hmm, there should still be a menu entry under Extensions called `Semi-empirical (xtb)` as soon as you’ve installed the plugin, even if you don’t have xtb itself yet.

You do have to restart Avogadro after installing the plugin, first of all.

Secondly, have you got Python installed on your machine? It’s needed to run any of the plugins.

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 3, 2024, 8:42pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/5 "2024-10-03T20:42:14Z")

</div>

Yes, I am also a bit confused…

 ![Extensions](https://discuss.avogadro.cc/uploads/default/original/2X/e/e8a55c8ad41001511d124ad92f873b0d7b4adb85.png)  
I restarted Avogadro, but still see no Semi-empirical entry - see screenshot. Also, I took a screenshot of the Python menu - I do have Python installed and Avogadro finds it, but maybe it’s a wrong version?

Thank you!

 ![Python](https://discuss.avogadro.cc/uploads/default/original/2X/2/2077a423852020a2e80d6926782e3c2106a8b55a.png)

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 4, 2024, 11:39am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/6 "2024-10-04T11:39:35Z")

</div>

Strange. When you go on `Extensions` =\> `Calculate` =\> `Configure…`, what force fields are available to you? If MMFF and UFF are offered, Python is at least working correctly for some stuff, but if not, it’s more likely to be a general problem rather than one specific to the xtb plugin.

This might be a stupid question, but is that definitely the path to your Python interpreter? Seems odd to have it installed under `.../Microsoft/WindowsApps/`, as [this StackOverflow question](https://stackoverflow.com/questions/76832124/where-was-python-installed) seems to indicate it should be under `C:/Users/vaverbuk/AppData/Local/Programs/Python3xx/` (where xx is 9, 10, 11 etc. for the Python version).

Did you perhaps install it from the Microsoft Store? I know that when Python is installed from the store it often results in all sorts of limitations. If so, maybe try installing from [python.org](http://python.org) and see if anything changes.

@ghutchis Geoff, do you know for a fact whether the MS Store Python definitely does or definitely doesn’t work for Avogadro’s purposes?

Finally, if you’re able to start Avogadro from the command line (accessed from Terminal or cmd or PowerShell for you), Avogadro will report some information on the results of its search for plugins, and that info would be useful for me/us 🙂

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 5, 2024, 12:14am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/7 "2024-10-05T00:14:52Z")

</div>

Extensions=\>Calculate=\>Configure gives MMFF94, UFF and a few other options, please see the screenshot

 ![Screenshot 2024-10-05 010425](https://discuss.avogadro.cc/uploads/default/original/2X/9/9e44616b4f7abcfd521565444a34728032aa423d.png)

Python appears to be installed within Anaconda3, python.exe is in C:\Program Data\Anaconda3

If I run this executable, I get a python shell with the following message:

Python 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:  
This Python interpreter is in a conda environment, but the environment has  
not been activated. Libraries may fail to load. To activate this environment  
please see [Managing environments — conda 26.5.4.dev137 documentation](https://conda.io/activation)

Type “help”, “copyright”, “credits” or “license” for more information.

> > >

I can start avogadro2.exe from powershell, but I get no messages at all, it just starts the program normally.

Can it be that installation of python within Anaconda confuses Avogadro?

Thank you!

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [October 5, 2024, 3:22am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/8 "2024-10-05T03:22:27Z")

</div>

> [@avervit](#):
>
> I can start avogadro2.exe from powershell, but I get no messages at all, it just starts the program normally.

Yes, on Windows it sends error messages to a file in Documents called `avogadro2.log`

> [@avervit](#):
>
> Can it be that installation of python within Anaconda confuses Avogadro?

It shouldn’t - you should be able to set the Python environment. The other indication that Python is working for Avogadro2 is the list of input generators. If Orca is there, then it’s finding `python`.

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 5, 2024, 11:01am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/9 "2024-10-05T11:01:28Z")

</div>

> [@avervit](#):
>
> Python appears to be installed within Anaconda3, python.exe is in C:\Program Data\Anaconda3

Ok then, that should work fine, but from this image:

> [@avervit](#):
>
> ![Python](https://discuss.avogadro.cc/uploads/default/original/2X/2/2077a423852020a2e80d6926782e3c2106a8b55a.png)

that doesn’t seem to be the interpreter that Avogadro is finding and using…

> [@ghutchis](#):
>
> Yes, on Windows it sends error messages to a file in Documents called `avogadro2.log`

If you could upload this, that would be the most useful first thing. Then, as a second thing, maybe try clicking on “Other…” in the Python Settings dialog, select the Conda Python at `C:\Program Data\Anaconda3`, and see if that changes anything. But please upload the log file _before_ you change the Python settings 🙂

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 6, 2024, 8:15am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/10 "2024-10-06T08:15:46Z")

</div>

> [@ghutchis](#):
>
> avogadro2.log

Thank you!

I did a full disc C:\ search and I do not have a file avogadro2.log on C. I also do not have any \*.log file related to Avogadro in Documents…

Is avogadro2.log supposed to be generated after every Avogadro2 run?

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 6, 2024, 4:21pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/11 "2024-10-06T16:21:09Z")

</div>

> [@avervit](#):
>
> Is avogadro2.log supposed to be generated after every Avogadro2 run?

I believe so.

> [@matterhorn103](#):
>
> Did you perhaps install it from the Microsoft Store?

I did some quick checking and it seems that `C:/Users/<user>/AppData/Local/Microsoft/WindowsApps/` is indeed the location where Windows stores programs downloaded from the Microsoft Store. It also seems that the folder has [very restricted permissions](https://www.makeuseof.com/windows-access-windowsapps-folder/) – read, you don’t have access or editing rights to the folder (despite it being within _your_ personal `AppData` folder) – so I suspect that I might have been right and that is the root of the issue.

> [@matterhorn103](#):
>
> Then, as a second thing, maybe try clicking on “Other…” in the Python Settings dialog, select the Conda Python at `C:\Program Data\Anaconda3`, and see if that changes anything.

So just try doing this (indicate to Avogadro that it should use the Conda Python rather than the one it’s currently using) and see what happens. And assuming you have Python listed amongst the installed programs in the Microsoft Store app, since you now have Conda Python installed I would also recommend uninstalling the Store version, so that Avogadro and other things that use Python don’t get confused.

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 6, 2024, 10:48pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/12 "2024-10-06T22:48:05Z")

</div>

Thank you!

I have changed the pyhton location to Anaconda and now, after restarting Avogadro2, I could see the semi-empirical (xtb) in the Extensions menu - great!

However, after running “get xtb” and receiving the message that xtb was successfully installed, I still do not see the “location of the xtb binary” in the Config

 ![Screenshot 2024-10-06 233551](https://discuss.avogadro.cc/uploads/default/original/2X/7/759887399c9721ae29383986b4799524ecc1d27d.png)  
ure menu - this field is empty:

The only xtb file I can see in my Programs folder is C:\Program Files\Avogadro2\lib\avogadro2\scripts\charges\xtb.py

---

<div class="post-metadata">

**Author:** ![brockdyer03](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/brockdyer03/32/2015_2.png) [@brockdyer03](https://discuss.avogadro.cc/u/brockdyer03)\
**Post date:** [October 6, 2024, 10:51pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/13 "2024-10-06T22:51:20Z")

</div>

I believe you need to set that location manually, if you didn’t already move the file to the XTB directory in Avogadro2’s file path

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 6, 2024, 11:38pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/14 "2024-10-06T23:38:18Z")

</div>

Thank you, the field is indeed editable, but the binary - something like xtb.exe - is missing. As far as I understand, it was supposed to be generated or downloaded by the xtb installation process run from the plugin. This - again, as far as I can see, did not happen.

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 7, 2024, 7:16am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/15 "2024-10-07T07:16:10Z")

</div>

Actually, the xtb binary is almost certainly there and is being found. Unfortunately there’s a bug with Avogadro itself where the first field in any plugin’s dialog is emptied, see [here](https://github.com/OpenChemistry/avogadrolibs/issues/1632). You’ll see that the same thing happens in the Configure, Run, and Conformers dialogs.

It’s tedious, but you can check what path is being used by looking at your config file at `Avogadro/commands/avo_xtb/config.json`.

Assuming that an xtb installation is being picked up, the pre-configured commands like `xtb` =\> `Optimize` etc. will work, so stick to those where possible for now.

If you need to use `Run` or `Conformers`, as a workaround for now you can copy the path from `config.json` and paste it into the empty box in the dialog. If the box is filled, everything will work fine, it’s just that the automatic population with the previously known value fails.

Let me know if this works for you.

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 7, 2024, 7:58pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/16 "2024-10-07T19:58:49Z")

</div>

Thank you, Matt, here is what I get trying to implement your suggestions.

I do not see “Optimise” in the Extensions–\> xtb menu - please see how it looks at the moment:

 ![Screenshot 2024-10-07 204832](https://discuss.avogadro.cc/uploads/default/original/2X/5/5d8d3caeaf100c7d2e4c818e60d36291d75e9679.png)

I do see the config.json file, and here is what it contains:  
{  
“solvent”: null,  
“energy\_units”: “kJ/mol”,  
“method”: 2,  
“opt\_lvl”: “normal”,  
“calc\_dir”: “C:\Users\vaverbuk\AppData\Local\OpenChemistry\Avogadro\commands\avo\_xtb\last”,  
“xtb\_bin”: “C:\Users\vaverbuk\AppData\Local\OpenChemistry\Avogadro\commands\avo\_xtb\xtb\bin\xtb”  
}

Copying the location of the xtb\_bin into the “location of xtb binary”, I get the same menu for xtb - without any clickable field which would start a calculation. The “go to calculation files” field is inactive - I can clock it but with no effect, probably because no calculation took place yet. Restarting Avogadro2 does not help, because the executable file field becomes empty…

It looks we still need one more step to actually make it work…

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 8, 2024, 8:21am UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/17 "2024-10-08T08:21:40Z")

</div>

Ugh, I’m sorry this is taking so long to set up.

What happens if you create a folder at the path given by `calc_dir`, does the “go to” button work then? And does it change anything about the available options?

I’ll see if I can try it on a Windows PC and work out what’s going on.

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 8, 2024, 9:01pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/18 "2024-10-08T21:01:01Z")

</div>

Sorry, Matt, I am a bit confused. At the path given by calc\_dir, I see a directory “last” with only one file inside it, called probe.txt and containing the following text:

This file is created only to check everything works.  
It will be deleted when the first calculation is run.

I can create another folder at this location, but shouldn’t it have some pre-defined name? If yes, then which one?

---

<div class="post-metadata">

**Author:** ![matterhorn103](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/matterhorn103/32/1751_2.png) [@matterhorn103](https://discuss.avogadro.cc/u/matterhorn103)\
**Post date:** [October 8, 2024, 9:32pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/19 "2024-10-08T21:32:00Z")

</div>

Ah ok, in that case you have already answered my question!

It seems you already have the folder, and that the plugin can write files to it without an issue. So what I thought might be the issue is apparently not an issue.

In which case I’m running out of ideas as to what the problem could be, I’m afraid. Sorry ☹ I’ll have a look myself on a Windows system in the next few days and see if I can work out what’s going on.

What you could do that might shed some more light: if you go to `C:/Users/vaverbuk/AppData/Local/OpenChemistry/Avogadro/commands/avo_xtb`, you will see all the Python script files of the plugin. Since you already have Python installed, if you are comfortable enough with the terminal/powershell/cmd you could try navigating to the folder and running some of the scripts with e.g. `python energy.py --menu-path` and `python energy.py --print-options`, and see what error messages get written to the output.

---

<div class="post-metadata">

**Author:** ![avervit](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/avervit/32/2504_2.png) [@avervit](https://discuss.avogadro.cc/u/avervit)\
**Post date:** [October 8, 2024, 9:59pm UTC](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340/20 "2024-10-08T21:59:54Z")

</div>

Thanks a lot, that would be great!

Here are the error messages I see in the powershell, they are the same no matter which one of the two commands I try to run:

Traceback (most recent call last):  
File “C:\Users\vaverbuk\AppData\Local\OpenChemistry\Avogadro\commands\avo\_xtb\energy.py”, line 13, in   
import convert  
File “C:\Users\vaverbuk\AppData\Local\OpenChemistry\Avogadro\commands\avo\_xtb\convert.py”, line 35, in   
) → list[str] | tuple[int, list[list[str]]]:  
TypeError: unsupported operand type(s) for |: ‘types.GenericAlias’ and ‘types.GenericAlias’

[Next page](https://discuss.avogadro.cc/t/xtb-plugin-installation/6340.md?page=2)
