VROOM-Project / pyvroom

Vehicle Routing Open-source Optimization Machine
BSD 2-Clause "Simplified" License
69 stars 14 forks source link

Python 3.11 support #65

Closed lgblkb369 closed 1 year ago

lgblkb369 commented 1 year ago

When using Python 3.11 pip install pyvroom produces the following error:

Collecting pyvroom
  Using cached pyvroom-0.0.14.tar.gz (32 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages (from pyvroom) (1.23.5)
Requirement already satisfied: pandas in /home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages (from pyvroom) (1.5.2)
Requirement already satisfied: python-dateutil>=2.8.1 in /home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages (from pandas->pyvroom) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages (from pandas->pyvroom) (2022.7)
Requirement already satisfied: six>=1.5 in /home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages (from python-dateutil>=2.8.1->pandas->pyvroom) (1.16.0)
Building wheels for collected packages: pyvroom
  Building wheel for pyvroom (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyvroom (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [101 lines of output]
      WARNING:root:Conan not installed and/or no conan build detected. Assuming dependencies are installed.
      INFO:root:running bdist_wheel
      INFO:root:running build
      INFO:root:running build_py
      INFO:root:creating build
      INFO:root:creating build/lib.linux-x86_64-cpython-311
      INFO:root:creating build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/vehicle.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/break_.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/job.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/__init__.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/location.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/amount.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:copying src/vroom/time_window.py -> build/lib.linux-x86_64-cpython-311/vroom
      INFO:root:creating build/lib.linux-x86_64-cpython-311/vroom/solution
      INFO:root:copying src/vroom/solution/solution.py -> build/lib.linux-x86_64-cpython-311/vroom/solution
      INFO:root:copying src/vroom/solution/__init__.py -> build/lib.linux-x86_64-cpython-311/vroom/solution
      INFO:root:creating build/lib.linux-x86_64-cpython-311/vroom/input
      INFO:root:copying src/vroom/input/forced_service.py -> build/lib.linux-x86_64-cpython-311/vroom/input
      INFO:root:copying src/vroom/input/__init__.py -> build/lib.linux-x86_64-cpython-311/vroom/input
      INFO:root:copying src/vroom/input/vehicle_step.py -> build/lib.linux-x86_64-cpython-311/vroom/input
      INFO:root:copying src/vroom/input/input.py -> build/lib.linux-x86_64-cpython-311/vroom/input
      INFO:root:running egg_info
      INFO:root:writing src/pyvroom.egg-info/PKG-INFO
      INFO:root:writing dependency_links to src/pyvroom.egg-info/dependency_links.txt
      INFO:root:writing entry points to src/pyvroom.egg-info/entry_points.txt
      INFO:root:writing requirements to src/pyvroom.egg-info/requires.txt
      INFO:root:writing top-level names to src/pyvroom.egg-info/top_level.txt
      ERROR:setuptools_scm.file_finder_git:listing git files failed - pretending there aren't any
      INFO:root:reading manifest file 'src/pyvroom.egg-info/SOURCES.txt'
      INFO:root:reading manifest template 'MANIFEST.in'
      WARNING:root:warning: no files found matching '*' under directory 'vroom'
      INFO:root:adding license file 'LICENSE'
      INFO:root:writing manifest file 'src/pyvroom.egg-info/SOURCES.txt'
      INFO:root:running build_ext
      INFO:root:gcc -pthread -B /home/phoenix/mambaforge/envs/twin_sim/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/phoenix/mambaforge/envs/twin_sim/include -fPIC -O2 -isystem /home/phoenix/mambaforge/envs/twin_sim/include -fPIC -Isrc -Ivroom/src -Ivroom/include -Ivroom/include/cxxopts/include -I/home/phoenix/mambaforge/envs/twin_sim/include/python3.11 -c flagcheck.cpp -o flagcheck.o -std=c++17
      gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
      compilation terminated.
      INFO:root:gcc -pthread -B /home/phoenix/mambaforge/envs/twin_sim/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/phoenix/mambaforge/envs/twin_sim/include -fPIC -O2 -isystem /home/phoenix/mambaforge/envs/twin_sim/include -fPIC -Isrc -Ivroom/src -Ivroom/include -Ivroom/include/cxxopts/include -I/home/phoenix/mambaforge/envs/twin_sim/include/python3.11 -c flagcheck.cpp -o flagcheck.o -std=c++14
      gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
      compilation terminated.
      INFO:root:gcc -pthread -B /home/phoenix/mambaforge/envs/twin_sim/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/phoenix/mambaforge/envs/twin_sim/include -fPIC -O2 -isystem /home/phoenix/mambaforge/envs/twin_sim/include -fPIC -Isrc -Ivroom/src -Ivroom/include -Ivroom/include/cxxopts/include -I/home/phoenix/mambaforge/envs/twin_sim/include/python3.11 -c flagcheck.cpp -o flagcheck.o -std=c++11
      gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
      compilation terminated.
      Traceback (most recent call last):
        File "/home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/phoenix/mambaforge/envs/twin_sim/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 413, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 76, in <module>
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/pybind11/setup_helpers.py", line 288, in build_extensions
          ext.cxx_std = auto_cpp_level(self.compiler)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ypdn2xhg/overlay/lib/python3.11/site-packages/pybind11/setup_helpers.py", line 271, in auto_cpp_level
          raise RuntimeError(msg)
      RuntimeError: Unsupported compiler -- at least C++11 support is needed!
      [end of output]

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

Python install wheels can be package to include binaries. We build the wheels for most python version, but hadn't enabled 3.11 yet. The error you are seeing is because you are missing the build dependencies to make the binary locally on your machine.

I've update the pipeline to enable py3.11 now in version 0.0.15. You should be able to install it without any issues.

lgblkb369 commented 1 year ago

Thanks. Solved.