# Announcing gmxapi 0.2 Python package

**URL:** <https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720>\
**Category:** Third party tools and files\
**Tags:** gmxapi\
**Created:** [March 9, 2021, 1:20pm UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720 "2021-03-09T13:20:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericirrgang](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ericirrgang/32/438_2.png) [@ericirrgang](https://gromacs.bioexcel.eu/u/ericirrgang)\
**Post date:** [March 9, 2021, 1:20pm UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/1 "2021-03-09T13:20:24Z")

</div>

Good news, everyone! The gmxapi 0.2 Python package is available for GROMACS 2021, and works best with the brand new release of GROMACS 2021.1.

After activating your new GROMACS installation ("source"ing your GMXRC), you should be able to just do `pip install --upgrade gmxapi` in your virtual environment. See also [Full installation instructions — GROMACS 2021.1 documentation](https://manual.gromacs.org/current/gmxapi/userguide/install.html#overview).

If you are using gmxapi to connect pluggable MD extension code to GROMACS simulations, continued compatibility should be easy, but may require some updates. The sample code at [GitHub - kassonlab/sample\_restraint](https://github.com/kassonlab/sample_restraint) has been confirmed to work with all gmxapi and supported GROMACS versions, and should be instructive.

For more information, email [info@gmxapi.org](mailto:info@gmxapi.org) or join the [Slack workspace](https://join.slack.com/t/gmxapi/shared_invite/zt-njwwlc41-EQ7D4nWjSRRAz11qF8_YWA)  
Also, feel free to tag me in posts to this forum.

Enjoy!

---

<div class="post-metadata">

**Author:** ![shivam1](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shivam1](https://gromacs.bioexcel.eu/u/shivam1)\
**Post date:** [February 14, 2022, 1:46am UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/2 "2022-02-14T01:46:11Z")

</div>

Hi, @ericirrgang

I tried to install gmxapi following the instructions available on [Full installation instructions — GROMACS 2021.5 documentation](https://manual.gromacs.org/current/gmxapi/userguide/install.html) but it shows the following error.

```auto
> ERROR: Failed building wheel for gmxapi
> Failed to build gmxapi
> ERROR: Could not build wheels for gmxapi, which is required to install pyproject.toml-based projects

```

since I am new to it, could you please help me in guiding on how to fix this error.

Thanks

---

<div class="post-metadata">

**Author:** ![ericirrgang](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ericirrgang/32/438_2.png) [@ericirrgang](https://gromacs.bioexcel.eu/u/ericirrgang)\
**Post date:** [February 14, 2022, 11:27am UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/3 "2022-02-14T11:27:25Z")

</div>

Hi, All.

The 0.2.3 version of the gmxapi package has been uploaded to [pypi.org](http://pypi.org) with a couple of small improvements, including a fix for a bug that prevented installation with double-precision builds of GROMACS.

@shivam1, if you had configured your GROMACS for full double-precision, try the newly uploaded 0.2.3 or 0.3.0 packages.

If CMake says that it cannot find GROMACS, make sure that you have “activated” GROMACS. The `gmx` binary (or `gmx_mpi` or `gmx_d`) should be on your path:

```auto
$ which gmx
/path/to/gromacs/bin/gmx

```

Check that GROMACS was installed with API support enabled.  
`ls /path/to/gromacs/lib` should show `libgromacs` and `libgmxapi`.  
`ls /path/to/gromacs/share/cmake/gmxapi` should show several `...cmake` files.

If these are missing, you will need to re-build and re-install GROMACS. When configuring with CMake, use `-DGMXAPI=ON`. (This is usually the default, but setting it explicitly may produce helpful error messages if there is something incompatible about your build configuration.)

If the files are there, but `pip` couldn’t find them, you will need to provide additional hints to `pip`. For gmxapi 0.2.x, refer to these hints on [gmxapi\_DIR](https://manual.gromacs.org/2021/gmxapi/userguide/install.html#gmxapi-dir) and [GMXTOOLCHAINDIR](https://manual.gromacs.org/2021/gmxapi/userguide/install.html#gmxtoolchaindir). For gmxapi 0.3.x, refer to these notes on [CMake hints](https://manual.gromacs.org/2022-rc1/gmxapi/userguide/install.html#gromacs-cmake-hints).

If that doesn’t work, please start a topic with the [gmxapi tag](https://gromacs.bioexcel.eu/tag/gmxapi). Please copy and paste complete output from the terminal. (Paste text rather than a screenshot to help people with vision challenges.) If the error output mentions additional log files for full CMake output, please also include a copy of the file.

---

<div class="post-metadata">

**Author:** ![shivam1](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shivam1](https://gromacs.bioexcel.eu/u/shivam1)\
**Post date:** [February 16, 2022, 8:24am UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/4 "2022-02-16T08:24:41Z")

</div>

@ericirrgang Thank you so much.

> [@ericirrgang](#):
>
> If these are missing, you will need to re-build and re-install GROMACS. When configuring with CMake, use `-DGMXAPI=ON` . (This is usually the default, but setting it explicitly may produce helpful error messages if there is something incompatible about your build configuration.)

so you mean i need to use

```auto

> cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMXAPI=ON

```

while installing cmake

---

<div class="post-metadata">

**Author:** ![ericirrgang](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ericirrgang/32/438_2.png) [@ericirrgang](https://gromacs.bioexcel.eu/u/ericirrgang)\
**Post date:** [February 16, 2022, 8:51am UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/5 "2022-02-16T08:51:30Z")

</div>

In CMake terminology, that is the “configure” step of a CMake-driven build process.

But, yes, try configuring with `-DGMXAPI=ON` to make sure that you will get a GROMACS installation with the required API for the Python package to build.

`GMXAPI=ON` is the default, but setting it explicitly will force additional output if there are problems.

---

<div class="post-metadata">

**Author:** ![RomanS](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RomanS](https://gromacs.bioexcel.eu/u/RomanS)\
**Post date:** [March 8, 2023, 8:40pm UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/6 "2023-03-08T20:40:26Z")

</div>

Hi Eric,

I have been away from gromacs for a little while, and I’m excited to see that gmxapi now provides a mechanism for performing gmx command line operations. I believe this was not the case in 2020? At the time I used Gromacs Wrapper for this, but that package does not appear to be maintained any longer.

I do have a question about the future of the command line interface. In the 2022 PLoS Comp Bio paper you refer to gmx command line operations as “legacy”. Does this mean that at some point the various gmx tools will be replaced by gmxapi, and possibly python code written on top of gmxapi?

Thanks!  
Roman

---

<div class="post-metadata">

**Author:** ![ericirrgang](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ericirrgang/32/438_2.png) [@ericirrgang](https://gromacs.bioexcel.eu/u/ericirrgang)\
**Post date:** [March 9, 2023, 6:46pm UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/7 "2023-03-09T18:46:29Z")

</div>

> mechanism for performing gmx command line operations. I believe this was not the case in 2020?

I believe [gmxapi.commandline\_operation](https://manual.gromacs.org/current/gmxapi/userguide/pythonreference.html#gmxapi.commandline_operation) was added in gmxapi 0.1.0, which shipped with release-2020. I think it got a lot more useful in release-2022, though.

> Does this mean that at some point the various gmx tools will be replaced by gmxapi, and possibly python code written on top of gmxapi?

Something like that will probably happen, for some tools, at least.

Some of the command line tools have been maintained and their code has been somewhat modernized, but more work is needed in the [Options framework](https://manual.gromacs.org/current/doxygen/html-user/group __module__ options.xhtml) for Python bindings to make sense and be maintainable.

Other tools have had little maintenance and may never be updated, even to the current C++ patterns.

I wouldn’t expect the traditional command line use cases to be wholly unsupported any time soon. Improved support for Python as a principal entry point is actively being explored, but there might not be significantly expanded bindings for another development cycle or two.

Please consider continuing the discussion in the (relatively new) [Developer discussions](https://gromacs.bioexcel.eu/c/gromacs-developers/10).

---

<div class="post-metadata">

**Author:** ![RomanS](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RomanS](https://gromacs.bioexcel.eu/u/RomanS)\
**Post date:** [March 10, 2023, 2:26pm UTC](https://gromacs.bioexcel.eu/t/announcing-gmxapi-0-2-python-package/1720/8 "2023-03-10T14:26:22Z")

</div>

Thanks Eric, I will keep an eye on the developer discussions!
