UPDATE: Installations using the last development version from GitHub often result in another error -Â
Cython.Compiler.Errors.CompileError: pysph/base/point.pyx. A question about it was already raised in this group message (
https://groups.google.com/g/pysph-users/c/UvVHef7MoRU/m/U3H2c-fSAwAJ), yet I wasn't able to find any solution. This was what I tried:
$Â conda create -n pysph -c conda-forge python=3.11 cython=0.29.36 numpy setuptools mako pytools pytest beaker mock h5py matplotlib mpi4py -y
$ conda activate pysph
$ pip install vtk
    tree = Parsing.p_module(s, pxd, full_module_name)
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/gpu_nnps_base.pxd:31:22: 'UINT_MAX' redeclared
   warning: pysph/base/gpu_nnps_base.pxd:32:13: 'INT_MAX' redeclared
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/linked_list_nnps.pyx:309:12: Unreachable code
   warning: pysph/base/linked_list_nnps.pyx:339:12: Unreachable code
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
   warning: pysph/base/gpu_nnps_base.pxd:31:22: 'UINT_MAX' redeclared
   warning: pysph/base/gpu_nnps_base.pxd:32:13: 'INT_MAX' redeclared
   warning: pysph/base/nnps_base.pxd:27:13: 'INT_MAX' redeclared
  Â
   Error compiling Cython file:
   ------------------------------------------------------------
   ...
  Â
     cdef IntPoint copy(self):
       return IntPoint_new(self.data.x, self.data.y, self.data.z)
  Â
     cpdef numpy.ndarray asarray(self):
       cdef numpy.ndarray[ndim=1,dtype=numpy.int_t] arr = numpy.empty(3,
                            ^
   ------------------------------------------------------------
  Â
   pysph/base/point.pyx:237:51: Invalid type.
   ----------------------------------------------------------------------
   Using OpenMP.
   ----------------------------------------------------------------------
   Warning: passing language='c++' to cythonize() is deprecated. Instead, put "# distutils: language=c++" in your .pyx or .pxd file(s)
   Compiling pysph/base/particle_array.pyx because it changed.
   Compiling pysph/base/point.pyx because it changed.
   Compiling pysph/base/nnps_base.pyx because it changed.
   Compiling pysph/base/linked_list_nnps.pyx because it changed.
   Compiling pysph/base/box_sort_nnps.pyx because it changed.
   Compiling pysph/base/spatial_hash_nnps.pyx because it changed.
   Compiling pysph/base/cell_indexing_nnps.pyx because it changed.
   Compiling pysph/base/z_order_nnps.pyx because it changed.
   Compiling pysph/base/stratified_hash_nnps.pyx because it changed.
   Compiling pysph/base/stratified_sfc_nnps.pyx because it changed.
   Compiling pysph/base/octree.pyx because it changed.
   Compiling pysph/base/octree_nnps.pyx because it changed.
   Compiling pysph/base/c_kernels.pyx because it changed.
   Compiling pysph/base/linalg3.pyx because it changed.
   Compiling pysph/tools/mesh_tools.pyx because it changed.
   Compiling pysph/base/gpu_nnps_base.pyx because it changed.
   Compiling pysph/base/z_order_gpu_nnps.pyx because it changed.
   Compiling pysph/base/stratified_sfc_gpu_nnps.pyx because it changed.
   Compiling pysph/base/octree_gpu_nnps.pyx because it changed.
   Compiling pysph/parallel/parallel_manager.pyx because it changed.
   [ 1/20] Cythonizing pysph/base/box_sort_nnps.pyx
   [ 2/20] Cythonizing pysph/base/c_kernels.pyx
   [ 3/20] Cythonizing pysph/base/cell_indexing_nnps.pyx
   [ 4/20] Cythonizing pysph/base/gpu_nnps_base.pyx
   [ 5/20] Cythonizing pysph/base/linalg3.pyx
   [ 6/20] Cythonizing pysph/base/linked_list_nnps.pyx
   [ 7/20] Cythonizing pysph/base/nnps_base.pyx
   [ 8/20] Cythonizing pysph/base/octree.pyx
   [ 9/20] Cythonizing pysph/base/octree_gpu_nnps.pyx
   [10/20] Cythonizing pysph/base/octree_nnps.pyx
   [11/20] Cythonizing pysph/base/particle_array.pyx
   [12/20] Cythonizing pysph/base/point.pyx
   Traceback (most recent call last):
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
     main()
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
     json_out['return_val'] = hook(**hook_input['kwargs'])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
     return hook(metadata_directory, config_settings)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/setuptools/build_meta.py", line 376, in prepare_metadata_for_build_wheel
     self.run_setup()
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/setuptools/build_meta.py", line 521, in run_setup
     super().run_setup(setup_script=setup_script)
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/setuptools/build_meta.py", line 319, in run_setup
     exec(code, locals())
    File "<string>", line 782, in <module>
    File "<string>", line 723, in setup_package
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1115, in cythonize
     cythonize_one(*args)
    File "/home/jachym/anaconda3/envs/pysph/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1238, in cythonize_one
     raise CompileError(None, pyx_file)
   Cython.Compiler.Errors.CompileError: pysph/base/point.pyx
   [end of output]
Â
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.