Skip to content

pip install hygese fails in Google Colab environment (missing build dependency 'cmake') #30

Description

@mdealencar

The current build system for HGS-CVRP implemented in setup.py requires python package cmake but pyproject.toml does not specify it as a build dependency.

%pip install hygese

Collecting hygese
  Downloading hygese-0.0.0.8.tar.gz (63 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.7/63.7 kB 1.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from hygese) (2.0.2)
Building wheels for collected packages: hygese
  error: subprocess-exited-with-error
  
  × Building wheel for hygese (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for hygese (pyproject.toml) ... error
  ERROR: Failed building wheel for hygese
Failed to build hygese
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (hygese)

Examining the output of %pip install --verbose hygese the problem seems to be in from cmake import cmake:

Building wheels for collected packages: hygese
  Running command Building wheel for hygese (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  HGS-CVRP-2.0.0/
  (...)
  === REDACTED ===
  (...)
  HGS-CVRP-2.0.0/Test/TestExecutable.cmake
  Traceback (most recent call last):
    File "/usr/local/bin/cmake", line 4, in <module>
      from cmake import cmake
  ModuleNotFoundError: No module named 'cmake'
  Build!!!!!! Run!!!!
  Traceback (most recent call last):
    File "/usr/local/lib/python3.11/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/usr/local/lib/python3.11/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/dist-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 "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/build_meta.py", line 438, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/build_meta.py", line 426, in _build
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 103, in <module>
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/dist.py", line 1105, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/command/bdist_wheel.py", line 370, in run
      self.run_command("build")
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/dist.py", line 1105, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/dist.py", line 1105, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-zfjh7le5/overlay/local/lib/python3.11/dist-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
    File "<string>", line 98, in run
    File "<string>", line 69, in download_build_hgs
    File "<string>", line 28, in _run
    File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../HGS-CVRP-2.0.0' returned non-zero exit status 1.
  error: subprocess-exited-with-error
  
  × Building wheel for hygese (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions