【问题标题】:Cannot build Python.NET Python.Runtime in Visual Studio from master, or via setup.py无法从 master 或 setup.py 在 Visual Studio 中构建 Python.NET Python.Runtime
【发布时间】:2020-11-23 12:00:47
【问题描述】:

我尝试从 Visual Studio 2019 中“构建解决方案”,因为 Python.NET 项目带有 .sln VS 解决方案文件

但是,它跳过了我感兴趣的 Python.Runtime 构建:

1>------ Skipped Build: Project: Python.Runtime ------

此外,其他 4 个构建有错误:

3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\NuGet\16.0\Microsoft.NuGet.targets(186,5): error : Your project file doesn't list 'win-x64' as a "RuntimeIdentifier". You should add 'win-x64' to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

另外,当按照https://github.com/pythonnet/pythonnet/wiki/Installation#github-installation-from-master-branch 上的说明运行python setup.py 时,我遇到了另一个错误,即无法找到已安装的Windows Kits 根目录。一直在寻找答案并尝试了不同版本的 Python、.NET Core、.NET 等,但均无济于事。我在https://github.com/pythonnet/pythonnet/issues/1272详细说明了它

环境

  • Pythonnet 版本:3.0(正在进行中,最新的 master 分支以 c81c3c3 结尾)
  • Python 版本:3.7.9
  • 操作系统:Windows 10、64 位、WinPE

【问题讨论】:

    标签: python.net winreg


    【解决方案1】:

    我刚刚加载了pythonnet.15.sln 而不是pythonnet.sln,并且能够构建 DLL 文件。

    虽然我仍然不确定为什么pythonnet.sln 对我不起作用,但“15”是否指的是 VS 版本?这张来自谈话https://youtu.be/P7Or7XzeIno?t=1163的屏幕截图中使用了常规的 sln

    【讨论】:

      猜你喜欢
      • 2016-08-02
      • 2018-05-08
      • 1970-01-01
      • 1970-01-01
      • 2017-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多