Valdes-Tresanco-MS / gmx_MMPBSA

gmx_MMPBSA is a new tool based on AMBER's MMPBSA.py aiming to perform end-state free energy calculations with GROMACS files.
https://valdes-tresanco-ms.github.io/gmx_MMPBSA/
GNU General Public License v3.0
229 stars 66 forks source link

[Bug-gmx_MMPBSA]: Failed building wheel for pandas #530

Closed hubertrybka closed 3 months ago

hubertrybka commented 3 months ago

Bug summary

The error occurs when installing gmx_MMPBSA (python -m pip install gmx_MMPBSA) in a conda environment (both stable and development release). All dependencied were installed succesfully. I encountered the error on two separate machines, both running Ubuntu 22.04.4.

Terminal output

pandas/_libs/src/ujson/python/JSONtoObj.c: In function ‘Object_npyEndArray’:
      pandas/_libs/src/ujson/python/JSONtoObj.c:195:49: warning: passing argument 1 of ‘PyArray_DATA’ from incompatible pointer type [-Wincompatible-pointer-types]
        195 |         new_data = PyDataMem_RENEW(PyArray_DATA(ret), i * npyarr->elsize);
            |                                                 ^~~
            |                                                 |
            |                                                 PyObject * {aka struct _object *}
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1508:35: note: expected ‘const PyArrayObject *’ {aka ‘const struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
       1508 | PyArray_DATA(const PyArrayObject *arr)
            |              ~~~~~~~~~~~~~~~~~~~~~^~~
      pandas/_libs/src/ujson/python/JSONtoObj.c: In function ‘Object_npyArrayAddItem’:
      pandas/_libs/src/ujson/python/JSONtoObj.c:260:31: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’
        260 |         npyarr->elsize = dtype->elsize;
            |                               ^~
      pandas/_libs/src/ujson/python/JSONtoObj.c:305:59: warning: passing argument 1 of ‘PyArray_DATA’ from incompatible pointer type [-Wincompatible-pointer-types]
        305 |             new_data = PyDataMem_RENEW(PyArray_DATA(npyarr->ret),
            |                                                     ~~~~~~^~~~~
            |                                                           |
            |                                                           PyObject * {aka struct _object *}
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1508:35: note: expected ‘const PyArrayObject *’ {aka ‘const struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
       1508 | PyArray_DATA(const PyArrayObject *arr)
            |              ~~~~~~~~~~~~~~~~~~~~~^~~
      pandas/_libs/src/ujson/python/JSONtoObj.c:316:24: warning: passing argument 1 of ‘PyArray_DIMS’ from incompatible pointer type [-Wincompatible-pointer-types]
        316 |     PyArray_DIMS(npyarr->ret)[0] = i + 1;
            |                  ~~~~~~^~~~~
            |                        |
            |                        PyObject * {aka struct _object *}
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1520:35: note: expected ‘const PyArrayObject *’ {aka ‘const struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
       1520 | PyArray_DIMS(const PyArrayObject *arr)
            |              ~~~~~~~~~~~~~~~~~~~~~^~~
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      pandas/_libs/src/ujson/python/JSONtoObj.c:318:39: warning: passing argument 1 of ‘PyArray_BYTES’ from incompatible pointer type [-Wincompatible-pointer-types]
        318 |     if ((item = PyArray_GETPTR1(npyarr->ret, i)) == NULL ||
            |                                 ~~~~~~^~~~~
            |                                       |
            |                                       PyObject * {aka struct _object *}
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:138:57: note: in definition of macro ‘PyArray_GETPTR1’
        138 | #define PyArray_GETPTR1(obj, i) ((void *)(PyArray_BYTES(obj) + \
            |                                                         ^~~
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1514:36: note: expected ‘const PyArrayObject *’ {aka ‘const struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
       1514 | PyArray_BYTES(const PyArrayObject *arr)
            |               ~~~~~~~~~~~~~~~~~~~~~^~~
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      pandas/_libs/src/ujson/python/JSONtoObj.c:318:39: warning: passing argument 1 of ‘PyArray_STRIDES’ from incompatible pointer type [-Wincompatible-pointer-types]
        318 |     if ((item = PyArray_GETPTR1(npyarr->ret, i)) == NULL ||
            |                                 ~~~~~~^~~~~
            |                                       |
            |                                       PyObject * {aka struct _object *}
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:139:62: note: in definition of macro ‘PyArray_GETPTR1’
        139 |                                          (i)*PyArray_STRIDES(obj)[0]))
            |                                                              ^~~
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
                       from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1526:38: note: expected ‘const PyArrayObject *’ {aka ‘const struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
       1526 | PyArray_STRIDES(const PyArrayObject *arr)
            |                 ~~~~~~~~~~~~~~~~~~~~~^~~
      pandas/_libs/src/ujson/python/JSONtoObj.c:319:31: warning: passing argument 1 of ‘PyArray_SETITEM’ from incompatible pointer type [-Wincompatible-pointer-types]
        319 |         PyArray_SETITEM(npyarr->ret, item, value) == -1) {
            |                         ~~~~~~^~~~~
            |                               |
            |                               PyObject * {aka struct _object *}
      In file included from /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
                       from pandas/_libs/src/ujson/python/JSONtoObj.c:42:
      /tmp/pip-build-env-ht_7oosp/overlay/lib/python3.10/site-packages/numpy/_core/include/numpy/ndarrayobject.h:292:32: note: expected ‘PyArrayObject *’ {aka ‘struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
        292 | PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v)
            |                 ~~~~~~~~~~~~~~~^~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pandas
Successfully built gmx_MMPBSA
Failed to build pandas
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pandas)

gmx_MMPBSA.log

No gmx_MMPBSA.log - it's not yet installed

Operating system

Ubuntu 22.04.4

gmx_MMPBSA Version

No response

Python version

Python 3.10.14

Installation

conda AmberTools + pip

hubertrybka commented 3 months ago

The issue seems to be with the Python version 3.10, which is recommended by official gmx_MMPBSA installation instructions to install when creating a new conda environment:

conda create -n gmxMMPBSA python=3.10 -y -q

Instead, do this:

conda create -n gmxMMPBSA python=3.9 -y -q

The installation of gmx_MMPBSA seems to have been successful with Python 3.9.

Valdes-Tresanco-MS commented 3 months ago

Thank you @hubertrybka. When I update the documentation with Python 3.10 it works as expected. It seems like the latest versions of Python 3.10 are incompatible