我希望能够安装 C 编译器,因为某些软件包没有我需要的轮子。 Windows 上大量的 Visual Studio 构建工具中所需的确切工具需要大量挖掘,并且安装需要很长时间。
我见过一些导致此问题的错误(请随意将其他错误添加到此列表中!)
- 库 mkl_rt、openblas、lapack 未找到,而...
- 错误:需要 Microsoft Visual C++ 14.0(无法找到 vcvarsall.bat)
- 首先,您需要从以下位置下载 Visual Studio 构建工具https://visualstudio.microsoft.com/downloads#other https://visualstudio.microsoft.com/downloads#other
- 创建一个名为 win_docker_test 的文件夹
- 在win_docker_test中创建一个名为bin的文件夹(win_docker_test/bin)
- 将 Visual Studio 构建工具放在 bin/ 目录中,并将文件重命名为 vs_buildtools.exe
- 复制下面的 Docker 文件
Dockerfile
# escape=`
# See https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile#:~:text=CMD%20reference.-,Escape%20character,-In%20many%20cases for explaining the above
FROM python:3.8.14-windowsservercore
# List here https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2022&preserve-view=true. We may be able to prune this list slightly!
COPY bin bin
RUN start-process -wait -filepath bin/vs_buildtools.exe -ArgumentList '--quiet --wait --norestart --nocache --installPath C:\BuildTools `
--add Microsoft.VisualStudio.ComponentGroup.VC.Tools.142.x86.x64 `
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
--add Microsoft.VisualStudio.Component.Windows10SDK `
--add Microsoft.VisualStudio.Component.VC.CoreIde `
--add Microsoft.VisualStudio.Component.VC.CMake.Project `
--add Microsoft.VisualStudio.Component.VC.14.29.16.11.CLI.Support `
--add Microsoft.VisualStudio.ComponentGroup.UWP.VC.v142'
RUN python -m pip install --upgrade pip setuptools wheel
- 进行任何您想要的调整,然后运行
docker build .
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)