Boost headers when installing cantera using pip under Windows 11

42 Views Asked by At

I tried to install cantera for python under Windows 11 by using this command:

py -m pip install cantera

But I get the folowing error:

Defaulting to user installation because normal site-packages is not writeable
Collecting cantera
  Using cached Cantera-3.0.0.tar.gz (5.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.12.0 in c:\users\benzinm\appdata\roaming\python\python312\site-packages (from cantera) (1.26.2)
Collecting ruamel.yaml>=0.15.34 (from cantera)
  Using cached ruamel.yaml-0.18.6-py3-none-any.whl.metadata (23 kB)
Requirement already satisfied: packaging in c:\users\benzinm\appdata\roaming\python\python312\site-packages (from cantera) (23.2)
Collecting ruamel.yaml.clib>=0.2.7 (from ruamel.yaml>=0.15.34->cantera)
  Using cached ruamel.yaml.clib-0.2.8-cp312-cp312-win_amd64.whl.metadata (2.3 kB)
Using cached ruamel.yaml-0.18.6-py3-none-any.whl (117 kB)
Using cached ruamel.yaml.clib-0.2.8-cp312-cp312-win_amd64.whl (115 kB)
Building wheels for collected packages: cantera
  Building wheel for cantera (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for cantera (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "C:\Users\BenzinM\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\BenzinM\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\BenzinM\AppData\Roaming\Python\Python312\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 "C:\Users\BenzinM\AppData\Local\Temp\pip-build-env-y5n0f8ns\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\BenzinM\AppData\Local\Temp\pip-build-env-y5n0f8ns\overlay\Lib\site-packages\setuptools\build_meta.py", line 395, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\BenzinM\AppData\Local\Temp\pip-build-env-y5n0f8ns\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 166, in <module>
        File "<string>", line 126, in configure_build
      ValueError: Could not find Boost headers. Please set an environment variable called BOOST_INCLUDE that contains the path to the Boost headers.
      [end of output]

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

Then I downloaded the Boost headers, extracted them under C:\boost and definded the user variable

C:\Users\BenzinM>echo %BOOST_INCLUDE%
C:\boost

Still get the same error. I should mention that I have no admin rights. Can anyone help me?

0

There are 0 best solutions below