I'm not sure if this is some limitation of Windows, but trying to build wheels for Python 3.13 on Windows would fail without admin privilege (I'm not familiar with Windows for dev at all, free feel to let me know if any info would be needed):
(venv313) PS D:\pymatgen> pip install spglib
Collecting spglib
Using cached spglib-2.5.0.tar.gz (2.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy<3,>=1.20 in d:\pymatgen\venv313\lib\site-packages (from spglib) (2.2.2)
Building wheels for collected packages: spglib
Building wheel for spglib (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for spglib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [123 lines of output]
C:\Users\Yang\AppData\Local\Temp\pip-build-env-uhuqtvnm\normal\Lib\site-packages\setuptools_scm\git.py:312: UserWarning: git archive did not support describe output
warnings.warn("git archive did not support describe output")
C:\Users\Yang\AppData\Local\Temp\pip-build-env-uhuqtvnm\normal\Lib\site-packages\setuptools_scm\git.py:331: UserWarning: unprocessed git archival found (no export subst applied)
warnings.warn("unprocessed git archival found (no export subst applied)")
*** scikit-build-core 0.10.7 using CMake 3.31.3 (wheel)
*** Configuring CMake...
loading initial cache file C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\CMakeInit.txt
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.26100.
-- The C compiler identification is MSVC 19.42.34435.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Spglib:: Build type: Release
-- Spglib:: Version 2.5.0
-- Found Python: D:\pymatgen\venv313\Scripts\python.exe (found suitable version "3.13.2", minimum required is "3.9") found components: Interpreter Development.Module NumPy
CMake Warning (dev) at python/CMakeLists.txt:126 (install):
Policy CMP0177 is not set: install() DESTINATION paths are normalized. Run
"cmake --help-policy CMP0177" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at python/CMakeLists.txt:126 (install):
Policy CMP0177 is not set: install() DESTINATION paths are normalized. Run
"cmake --help-policy CMP0177" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at python/CMakeLists.txt:126 (install):
Policy CMP0177 is not set: install() DESTINATION paths are normalized. Run
"cmake --help-policy CMP0177" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at python/CMakeLists.txt:126 (install):
Policy CMP0177 is not set: install() DESTINATION paths are normalized. Run
"cmake --help-policy CMP0177" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at python/CMakeLists.txt:134 (install):
Policy CMP0177 is not set: install() DESTINATION paths are normalized. Run
"cmake --help-policy CMP0177" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done (3.1s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build
*** Building project with Visual Studio 17 2022...
MSBuild version 17.12.12+1cce77968 for .NET Framework
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\ZERO_CHECK.vcxproj]
1>Checking Build System
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\Spglib_DynamicVersion.vcxproj]
1>
Building Custom Rule C:/Users/Yang/AppData/Local/Temp/pip-install-9nvquceg/spglib_a09c3a72e6284d2397464ce14e41266e/CMakeLists.txt
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\Spglib_Version.vcxproj]
1>
Building Custom Rule C:/Users/Yang/AppData/Local/Temp/pip-install-9nvquceg/spglib_a09c3a72e6284d2397464ce14e41266e/CMakeLists.txt
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\Spglib_GitHash.vcxproj]
1>
Building Custom Rule C:/Users/Yang/AppData/Local/Temp/pip-install-9nvquceg/spglib_a09c3a72e6284d2397464ce14e41266e/CMakeLists.txt
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\Spglib_symspg.vcxproj]
Building Custom Rule C:/Users/Yang/AppData/Local/Temp/pip-install-9nvquceg/spglib_a09c3a72e6284d2397464ce14e41266e/CMakeLists.txt
arithmetic.c
cell.c
debug.c
delaunay.c
determination.c
hall_symbol.c
kgrid.c
kpoint.c
magnetic_spacegroup.c
mathfunc.c
msg_database.c
niggli.c
overlap.c
pointgroup.c
primitive.c
refinement.c
site_symmetry.c
sitesym_database.c
spacegroup.c
spg_database.c
Generating Code...
Compiling...
spglib.c
spin.c
symmetry.c
Generating Code...
Creating library C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/Release/symspg.lib and object C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/Release/symspg.exp
Spglib_symspg.vcxproj -> C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\Release\symspg.dll
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
Building Custom Rule C:/Users/Yang/AppData/Local/Temp/pip-install-9nvquceg/spglib_a09c3a72e6284d2397464ce14e41266e/python/CMakeLists.txt
_spglib.c
Creating library C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/python/Release/_spglib.lib and object C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/python/Release/_spglib.exp
Spglib_python.vcxproj -> C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Release\_spglib.cp313-win_amd64.pyd
EXEC : CMake error : failed to create symbolic link 'C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/python/spglib/_spglib.cp313-win_amd64.pyd': A required privilege is not held by the client. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command "setlocal [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E create_symlink C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/python/Release/_spglib.cp313-win_amd64.pyd C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/python/spglib/_spglib.cp313-win_amd64.pyd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1 [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: setlocal [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E copy "C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.13_3.13.752.0_x64__qbz5n2kfra8p0/python313.dll" C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/Release/symspg.dll C:/Users/Yang/AppData/Local/Temp/tmph2mhsunn/build/python/spglib/ [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1 [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited with code 1. [C:\Users\Yang\AppData\Local\Temp\tmph2mhsunn\build\python\Spglib_python.vcxproj]
*** CMake build failed
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for spglib
Failed to build spglib
ERROR: Failed to build installable wheels for some pyproject.toml based projects (spglib)
(venv313) PS D:\pymatgen> pip install spglib
Collecting spglib
Using cached spglib-2.5.0.tar.gz (2.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy<3,>=1.20 in d:\pymatgen\venv313\lib\site-packages (from spglib) (2.2.2)
Building wheels for collected packages: spglib
Building wheel for spglib (pyproject.toml) ... done
Created wheel for spglib: filename=spglib-2.5.0-cp313-cp313-win_amd64.whl size=300587 sha256=6b251c45168191dcb3276515eeeced504c074ee1db9d0841073af819fbca488b
Stored in directory: c:\users\yang\appdata\local\pip\cache\wheels\f4\b3\8b\98f884eae8ca7f6e61db78383c9c03bfa06a8ac894bc0310a9
Successfully built spglib
Installing collected packages: spglib
Successfully installed spglib-2.5.0
I'm not sure if this is some limitation of Windows, but trying to build wheels for Python 3.13 on Windows would fail without admin privilege (I'm not familiar with Windows for dev at all, free feel to let me know if any info would be needed):
But works fine as admin: