William Hickey
William Hickey

Reputation: 11

error whenever I try to pip install apriltag

Collecting apriltag
 Using cached apriltag-0.0.16.tar.gz (201 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
   Getting requirements to build wheel: finished with status 'done'

  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
  Building wheels for collected packages: apriltag
  Building wheel for apriltag (pyproject.toml): started
   Building wheel for apriltag (pyproject.toml): finished with status 'error'
   Failed to build apriltag

 error: subprocess-exited-with-error

   Building wheel for apriltag (pyproject.toml) did not run successfully.
 exit code: 1
  [74 lines of output]
  running bdist_wheel
     running build
    running build_py
    creating build
   creating build/lib.macosx-10.9-universal2-cpython-311
     copying python/apriltag.py -> build/lib.macosx-10.9-universal2-cpython-311
     running build_ext
     Traceback (most recent call last):
      File "<string>", line 24, in run
      File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py",           line 466, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
      with Popen(*popenargs, **kwargs) as process:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1950, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Library/Frameworks/Python.framework/Versions/3.11/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 "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 434, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
      self.run_setup()
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 62, in <module>
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 369, in run
      self.run_command("build")
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/private/var/folders/gc/kpkvk__x4bg0ghv_lgfv7y640000gp/T/pip-build-env-bjp4e0h5/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 26, in run
  RuntimeError: CMake must be installed to build the following extensions: apriltags
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for apriltag ERROR: Could not build wheels for apriltag, which is required to install pyproject.toml-based projects


tried pip install apriltag on pycharm and pip3 install apriltag on terminal any help would be great thank you!

Upvotes: 1

Views: 409

Answers (1)

ehsan mohseni
ehsan mohseni

Reputation: 1

first try this command:

pip install cmake or pip3 install cmake

then pip install apriltag or pip3 install apriltag

if not work

sudo apt-get update && sudo apt-get upgrade

and you can use this command to install cmake

brew install cmake

Upvotes: 0

Related Questions