ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject error

1,410 views
Skip to first unread message

Ibrahim Mohamed

unread,
Sep 22, 2023, 10:48:10 AM9/22/23
to westpa-users
i have installed westpa using conda commands in a new environement but when i try to run a simulation, this error is produced:


Traceback (most recent call last):
  File "/share/apps/conda_envs/cairo029_westpa-2.0/bin/w_init", line 7, in <module>
    from westpa.cli.core.w_init import entry_point
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/westpa/__init__.py", line 4, in <module>
    from .core.systems import WESTSystem
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/westpa/core/systems.py", line 6, in <module>
    from westpa.core.binning import NopMapper
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/westpa/core/binning/__init__.py", line 18, in <module>
    from .mab_manager import MABSimManager
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/westpa/core/binning/mab_manager.py", line 4, in <module>
    from westpa.core.sim_manager import WESimManager, grouper
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/westpa/core/sim_manager.py", line 14, in <module>
    from .data_manager import weight_dtype
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/westpa/core/data_manager.py", line 53, in <module>
    import h5py
  File "/share/apps/conda_envs/cairo029_westpa-2.0/lib/python3.9/site-packages/h5py/__init__.py", line 25, in <module>
    from . import _errors
  File "h5py/_errors.pyx", line 1, in init h5py._errors
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

i have numpy version 1.20.1 and python 3.8.8. i tried to search for a solution and i found that upgrading numpy could solve it. is this the solution or there is another solution?

thanks

Jeremy Leung

unread,
Sep 22, 2023, 10:57:27 AM9/22/23
to westpa-users
Hi Ibrahim,

You claim you are using python 3.8.8, but when you run w_init, it's calling westpa from your `cairo029_westpa-2.0` environment, which has python 3.9. Are you sure you're in the right environment and calling the correct installation of westpa? How did you install your new environment?

-- JL

hollowic...@gmail.com

unread,
Sep 22, 2023, 11:07:10 AM9/22/23
to westpa...@googlegroups.com, Jeremy Leung
Actually i am not the one who installed it. The environment was installed on a remote hpc using the commands from the git hub (i copy and pasted the commands to the hpc support).
I wrote that the version is 3.8.8 because after I activated the environment and opened python the version that appeared is 3.8.8


On Fri, 22 Sept 2023 at 5:57 pm, Jeremy Leung

--
You received this message because you are subscribed to the Google Groups "westpa-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to westpa-users...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/westpa-users/1f1c6e6d-2a2c-49b2-a896-51560d1e0e38n%40googlegroups.com
.

hollowic...@gmail.com

unread,
Sep 22, 2023, 11:17:22 AM9/22/23
to westpa...@googlegroups.com, Jeremy Leung
i am very sorry. i checked the activation command and found that it was missing the "a" letter in activate.

Jeremy Leung

unread,
Sep 22, 2023, 11:19:25 AM9/22/23
to westpa-users
Hi Ibrahim,

Glad that missing "a" solved it.

Though for future reference:
I suspect when WESTPA is compiled, it was done with a different numpy version, and somehow that numpy version is upgraded/downgraded/changed during subsequent step(s), causing binary incompatibility.

There are many ways to do it, but I suggest you contacting the help desk from HPC (whoever made this this environment for you). To limit the amount of package incompatibility and such, ensure they rebuild the environment from scratch and only install everything through conda (not pip), including WESTPA.

-- JL

hollowic...@gmail.com

unread,
Sep 22, 2023, 11:29:10 AM9/22/23
to westpa-users
okay thank you for your advice.
actually the problem was that after i activate the WESTPA environment (contain numpy version 1.26) i load GROMACS which has a lower version of numpy (1.20) therefore i needed to unload this numpy first before running the simulation

Reply all
Reply to author
Forward
0 new messages