Having a problem installing libcst, does this really require C compiler to be installed?
Error below:
copying lib\yaml\__init__.py -> build\lib.win-amd64-cpython-315\yaml
creating build\lib.win-amd64-cpython-315\_yaml
copying lib\_yaml\__init__.py -> build\lib.win-amd64-cpython-315\_yaml
running build_ext
No `pyyaml_build_config` setting found.
skipping 'yaml\_yaml.c' Cython extension (up-to-date)
BUILDING CYTHON EXT; self.include_dirs=['C:\\Program Files\\Python315\\include', 'C:\\Program Files\\Python315\\Include'] self.library_dirs=['C:\\Program Files\\Python315\\libs', 'C:\\Program Files\\Python315', 'C:\\Program Files\\Python315\\PCbuild\\amd64'] self.define=None
building 'yaml._yaml' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyyaml
Failed to build pyyaml
error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects
╰─> pyyaml
For parsing, LibCST ships with a native extension, so releases are distributed as binary wheels as well as the source code. If a binary wheel is not available for your system (Linux/Windows x86/x64 and Mac x64/arm are covered), you’ll need a recent Rust toolchain for installing.
@barry-scott Have found a suitable wheel file “libcst-1.9.0-cp315-cp315t-win_amd64.whl” but where do I go from here. How do I tell the installer to use this file?
Edit:
I am using PyCharm 2026.2.3 if it can be installed using that it would be preferable but if not can I install from the .venv command prompt.
Edit2:
Have tried installing from command line insode .venv but:
ERROR: libcst-1.9.0-cp315-cp315t-win_amd64.whl is not a supported wheel on this platform.
Edit3:
Now found a non free-threaded wheel - libcst-1.9.0-cp315-cp315-win_amd64.whl; however this fails with:
creating build\\lib.win-amd64-cpython-315\\\_yaml
copying lib\\\_yaml\\\__init_\_.py -> build\\lib.win-amd64-cpython-315\\\_yaml
running build_ext
No \`pyyaml_build_config\` setting found.
skipping 'yaml\\\_yaml.c' Cython extension (up-to-date)
BUILDING CYTHON EXT; self.include_dirs=\['…\\.venv\\\\include', 'C:\\\\Program Files\\\\Python315\\\\include', 'C:\\\\Program Files\\\\Python315\\\\Include'\] self.library_dirs=\['…\\\\.venv\\\\libs', 'C:\\\\Program Files\\\\Python315\\\\libs', 'C:\\\\Program Files\\\\Python315', '…\\\\.venv\\\\PCbuild\\\\amd64'\] self.define=None
building 'yaml.\_yaml' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
\[end of output\]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyyaml
Failed to build pyyaml
error: failed-wheel-build-for-install
You shouldn’t have to dig around and find wheels yourself. Your library installer (pip install or uv pip install) should do that for you. How did you create your Python environment? What does python -V show? Can you show the complete installation command you ran and all of its output?
When you install a package, you also install all of its direct dependencies. In this case, PyYAML does not yet provide wheels for Python 3.15, and so you would need a C toolchain to build it. On Windows, installing either of Visual Studio Community or Build Tools for Visual Studio should be sufficient.
As @nedbat said, you do not need to go searching for wheels for yourself, pip (or uv) will find them on PyPI for you, if they exist.
Your other option is to install Python 3.14 (pymanager install 3.14), for which PyYAML provides current wheels.
@nedbat .venv environment was originally created by PyCharm. All commands are currently being run from a command prompt in this environment. python -v output below but it is quite long I’m afraid:
And here is the full output from pip install libcst:
(.venv) <devPath>\.venv\Scripts>pip install libcst
Collecting libcst
Using cached libcst-1.9.0-cp315-cp315-win_amd64.whl.metadata (15 kB)
Collecting pyyaml>=6.0.3 (from libcst)
Using cached pyyaml-6.0.3.tar.gz (130 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Using cached libcst-1.9.0-cp315-cp315-win_amd64.whl (2.2 MB)
Building wheels for collected packages: pyyaml
Building wheel for pyyaml (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyyaml (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
<roamingUserPath>\Temp\pip-build-env-q1v32_jv\overlay\Lib\site-packages\setuptools\_vendor\wheel\bdist_wheel.py:4: FutureWarning: The 'wheel' package is no longer the canonical location of the 'bdist_wheel' command, and will be removed in a future release. Please update to setuptools v70.1 or later which contains an integrated version of this command.
warn(
<roamingUserPath>\Temp\pip-build-env-q1v32_jv\overlay\Lib\site-packages\setuptools\dist.py:765: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: MIT License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
self._finalize_license_expression()
running bdist_wheel
running build
running build_py
creating build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\composer.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\constructor.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\cyaml.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\dumper.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\emitter.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\error.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\events.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\loader.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\nodes.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\parser.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\reader.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\representer.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\resolver.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\scanner.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\serializer.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\tokens.py -> build\lib.win-amd64-cpython-315\yaml
copying lib\yaml\__init__.py -> build\lib.win-amd64-cpython-315\yaml
creating build\lib.win-amd64-cpython-315\_yaml
copying lib\_yaml\__init__.py -> build\lib.win-amd64-cpython-315\_yaml
running build_ext
No `pyyaml_build_config` setting found.
skipping 'yaml\_yaml.c' Cython extension (up-to-date)
BUILDING CYTHON EXT; self.include_dirs=['D:\\Dev\\Python\\PythonWebserver\\.venv\\include', 'C:\\Program Files\\Python315\\include', 'C:\\Program Files\\Python315\\Include'] self.library_dirs=['D:\\Dev\\Python\\PythonWebserver\\.venv\\libs', 'C:\\Program Files\\Python315\\libs', 'C:\\Program Files\\Python315', 'D:\\Dev\\Python\\PythonWebserver\\.venv\\PCbuild\\amd64'] self.define=None
building 'yaml._yaml' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyyaml
Failed to build pyyaml
error: failed-wheel-build-for-install
× Failed to build installable wheels for some pyproject.toml based projects
╰─> pyyaml
(.venv) <devPath>\.venv\Scripts>
There’s a big difference between python -v (verbose mode, which prints imports) and python -V (display the version); Ned asked about the version, but the question was answered (close enough) by the win-amd64-cpython-315 tag in the output provided.
you could try, but I personally wouldn’t trust it. Much simpler to follow the link provided in the failure output to get the Microsoft C++ Build Tools and be able to build your own. If you so insist, you would need to make use of the --no-dependencies flag to pip install.
(.venv) <devPath>\.venv\Scripts>pip install pyyaml-cp315
Collecting pyyaml-cp315
Downloading pyyaml_cp315-6.0.3.tar.gz (306 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyyaml-cp315
Building wheel for pyyaml-cp315 (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyyaml-cp315 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
<roamingUserPath>\Temp\pip-build-env-b0_thqx5\overlay\Lib\site-packages\setuptools\_vendor\wheel\bdist_wheel.py:4: FutureWarning: The 'wheel' package is no longer the canonical location of the 'bdist_wheel' command, and will be removed in a future release. Please update to setuptools v70.1 or later which contains an integrated version of this command.
@zware I really didn’t want to install C/C++ compiler unless absolutely essential. I have seen too many Windows problems in the past caused by that installation.
That failure is because pyyaml-cp315 does not provide Windows wheels.
I’ve never seen such problems.
Your remaining options are to bump down to Python 3.14 as we’ve mentioned a couple of times, or build the wheel on another (optionally virtual) machine that has the build tools.
I’m having a bit of trouble trying to understand what exactly is going on here with this failed install. I can download what I believe to be the correct wheel libcst-1.9.0-cp315-cp315-win_amd64.whl but installing that directly still fails with ERROR: Failed building wheel for pyyaml.
Trying to install pyyaml_cp315-6.0.3-cp315-cp315t-musllinux_1_2_x86_64.whl for example fails with ERROR: pyyaml_cp315-6.0.3-cp315-cp315t-musllinux_1_2_x86_64.whl is not a supported wheel on this platform. How can that be, it is listed as suitable for x86-64?
Is there really no x86-64 wheel available anywhere for pyyaml?
pyyaml_cp315-6.0.3-cp315-cp315t-musllinux_1_2_x86_64.whl appears to be a Linux wheel, not a Windows wheel. If you’re unwilling to install the tool chain to compile it yourself, it sounds like your best course of action is to just stick to Python 3.14 until this package gets an appropriate wheel for 3.15.
win_amd64 in the file name means it’s for Windows. musllinux in the file name means it’s for Linux.
You really shouldn’t try to find and download your own wheels. Pip will find you the right ones if they are available. 3.15 is still quite new, and some projects haven’t yet provided the needed wheels. I would recommend using 3.14 for now.