makehumancommunity / makehuman

This is the main repository for the MakeHuman application as such.
http://www.makehumancommunity.org
Other
1.18k stars 244 forks source link

Building makehuman fails with numpy 1.24+ in compile_targets.py #217

Closed sthen closed 1 year ago

sthen commented 1 year ago

Prior to 1.24, running compile_targets.py for makehuman displayed a deprecation warning:

cd /usr/obj/ports/makehuman-1.2.0/makehuman-1.2.0/makehuman && /usr/local/bin/python3.10 compile_targets.py
/usr/local/lib/python3.10/site-packages/numpy/lib/npyio.py:521: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  arr = np.asanyarray(arr)

After 1.24, this has turned into an error - "Ragged array creation will now always raise a ValueError unless dtype=object is passed. This includes very deeply nested sequences." in release notes; see https://github.com/numpy/numpy/pull/22004 for more. With this, compile_targets.py now fails:

cd /usr/obj/ports/makehuman-1.2.0/makehuman-1.2.0/makehuman && /usr/local/bin/python3.10 compile_targets.py
Traceback (most recent call last):
  File "/usr/obj/ports/makehuman-1.2.0/makehuman-1.2.0/makehuman/compile_targets.py", line 74, in <module>
    np.save(lpath, makehuman.getAssetLicense().toNumpyString())
  File "<__array_function__ internals>", line 200, in save
  File "/usr/local/lib/python3.10/site-packages/numpy/lib/npyio.py", line 521, in save
    arr = np.asanyarray(arr)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

Do you have any suggestions how to fix? I don't know either numpy or makehuman particularly well, just trying to fix an OS packaging problem. Thanks!

Aranuvir commented 1 year ago

Thanks for reporting the bug. We will have to investigate...