sonos/pyFLAC

No module named 'distutils.msvc9compiler'

Opened this issue · 1 comments

OS: Windows10 (64) @ VS2017 VS2019 VS2020
Python 3.11.9 (64)
setuptools 74.0.0

pip3 install pyflac

Error:

Using cached pyFLAC-3.0.0.tar.gz (1.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [44 lines of output]
      Traceback (most recent call last):
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\cffi\_shimmed_dist_utils.py", line 33, in <module>
          from distutils.msvc9compiler import MSVCCompiler
      ModuleNotFoundError: No module named 'distutils.msvc9compiler'
     
      The above exception was the direct cause of the following exception:
     
      Traceback (most recent call last):
        File "C:\dev\python\3.11.4\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\dev\python\3.11.4\Lib\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:\dev\python\3.11.4\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\build_meta.py", line 373, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 14, in <module>
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 146, in setup
          _setup_distribution = dist = klass(attrs)
                                       ^^^^^^^^^^^^
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\dist.py", line 283, in __init__
          _Distribution.__init__(self, dist_attrs)
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 278, in __init__
          self.finalize_options()
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\dist.py", line 635, in finalize_options
          ep(self)
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\setuptools\dist.py", line 655, in _finalize_setup_keywords
          ep.load()(self, ep.name, value)
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\cffi\setuptools_ext.py", line 216, in cffi_modules
          add_cffi_module(dist, cffi_module)
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\cffi\setuptools_ext.py", line 71, in add_cffi_module
          _add_c_module(dist, ffi, module_name, source, source_extension, kwds)
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\cffi\setuptools_ext.py", line 109, in _add_c_module
          from cffi._shimmed_dist_utils import Extension, log, mkpath
        File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-jg6mg6l4\overlay\Lib\site-packages\cffi\_shimmed_dist_utils.py", line 39, in <module>
          raise Exception("This CFFI feature requires distutils. Please install the distutils or setuptools package.") from ex
      Exception: This CFFI feature requires distutils. Please install the distutils or setuptools package.
      [end of output]

Thanks for reporting this. I am not too familiar with Windows, but could you check if you have the "Microsoft Visual C++ Build Tools" installed?