pythonpypychipmunkpymunk

Failed building wheel for pymunk using pypy3


I am trying to install pymunk using the command pypy3 -m pip install pymunk

The output I get is:

Defaulting to user installation because normal site-packages is not writeable
Collecting pymunk
  Using cached pymunk-6.4.0.zip (7.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi>=1.15.0 in /usr/lib/pypy3.8 (from pymunk) (1.15.0)
Building wheels for collected packages: pymunk
  Building wheel for pymunk (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pymunk (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [109 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-pypy38
      creating build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/transform.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/bb.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/query_info.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_types.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/util.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/shape_filter.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/space_debug_draw_options.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/constraints.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_pyglet15_util.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_typing_attr.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_chipmunk_cffi.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_pickle.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/matplotlib_util.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/contact_point_set.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/autogeometry.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/pyglet_util.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_version.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/pymunk_extension_build.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/arbiter.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/collision_handler.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/__init__.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/shapes.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/_callbacks.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/pygame_util.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/vec2d.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/space.py -> build/lib.linux-x86_64-pypy38/pymunk
      copying pymunk/body.py -> build/lib.linux-x86_64-pypy38/pymunk
      creating build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_transform.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_shape_filter.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_space_debug_draw_options.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_autogeometry.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_bb.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_arbiter.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/doctests.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_constraint.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_shape.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_common.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_vec2d.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_space.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/__main__.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/__init__.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      copying pymunk/tests/test_body.py -> build/lib.linux-x86_64-pypy38/pymunk/tests
      creating build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/box2d_pyramid.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/constraints.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/point_query.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/camera.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/platformer.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/planet.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/newtons_cradle.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/breakout.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/pyglet_util_demo.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/basic_test.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/threaded_space.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/matplotlib_util_demo.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/index_video.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/arrows.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/contact_and_no_flipy.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/contact_with_friction.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/tank.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/copy_and_pickle.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/shapes_for_draw_demos.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/damped_rotary_spring_pointer.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/spiderweb.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/balls_and_lines.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/flipper.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/pygame_util_demo.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/__main__.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/__init__.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/using_sprites_pyglet.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/bouncing_balls.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/deformable.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/box2d_vertical_stack.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/using_sprites.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/playground.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      copying pymunk/examples/slide_and_pinjoint.py -> build/lib.linux-x86_64-pypy38/pymunk/examples
      running egg_info
      writing pymunk.egg-info/PKG-INFO
      writing dependency_links to pymunk.egg-info/dependency_links.txt
      writing requirements to pymunk.egg-info/requires.txt
      writing top-level names to pymunk.egg-info/top_level.txt
      reading manifest file 'pymunk.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'docs/src/_build'
      warning: no files found matching '*.wav' under directory 'additional_examples'
      no previously-included directories found matching 'additional_examples/.ipynb_checkpoints'
      no previously-included directories found matching 'additional_examples/build'
      no previously-included directories found matching 'additional_examples/dist'
      no previously-included directories found matching '**/__pycache__'
      adding license file 'LICENSE.txt'
      writing manifest file 'pymunk.egg-info/SOURCES.txt'
      copying pymunk/py.typed -> build/lib.linux-x86_64-pypy38/pymunk
      running build_ext
      generating cffi module 'build/temp.linux-x86_64-pypy38/pymunk._chipmunk.c'
      creating build/temp.linux-x86_64-pypy38
      building 'pymunk._chipmunk' extension
      creating build/temp.linux-x86_64-pypy38/Chipmunk2D
      creating build/temp.linux-x86_64-pypy38/Chipmunk2D/src
      creating build/temp.linux-x86_64-pypy38/build
      creating build/temp.linux-x86_64-pypy38/build/temp.linux-x86_64-pypy38
      cc -pthread -DNDEBUG -O2 -fPIC -IChipmunk2D/include -I/usr/include/pypy3.8 -c Chipmunk2D/src/chipmunk.c -o build/temp.linux-x86_64-pypy38/Chipmunk2D/src/chipmunk.o -std=c99
      error: command 'cc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pymunk
Failed to build pymunk
ERROR: Could not build wheels for pymunk, which is required to install pyproject.toml-based projects```

I have tried to use pypy3 -m pip install wheel but it doesn't solve the issue.

Other packages (ex. pyglet) have installed just fine.

When I try to install the .whl file manually by downloading it I get:

Defaulting to user installation because normal site-packages is not writeable
ERROR: pymunk-5.6.0-py2.py3-none-win_amd64.whl is not a supported wheel on this platform.

I'm using Ubuntu 22.04.2 LTS

How do I get pymunk to install with pypy3?


Solution

  • I was using the wrong version of the wheel file. It is working now.