ValueError:未知的 MS 编译器版本 1900

2023-12-14

我正在尝试使用 cygwin (mingw) 在 Windows 10 上使用 Python 3.5 运行一些代码。准确地说,我使用的是 PyDSTool 模块,我将其称为 dopri 积分器。问题是,我遇到了麻烦distutils无法识别 Microsoft Visual Studio 2015。有没有办法避免这种情况(无需返回旧版本的 Python、Windows、Visual Studio)。完整的错误如下所示。

ValueError                                Traceback (most recent call last)
<ipython-input-16-bfeb915bfd7b> in <module>()
     60 print("\n")
     61 
---> 62 testODE = Dopri_ODEsystem(DSargs)
     63 
     64 print('Integrating...')

C:\Anaconda3\lib\site-packages\PyDSTool\Generator\Dopri_ODEsystem.py in __init__(self, kw)
    371             print("stages using the makeLibSource and compileLib methods.")
    372         else:
--> 373             self.makeLib()
    374 
    375     @property

C:\Anaconda3\lib\site-packages\PyDSTool\Generator\mixins.py in makeLib(self, libsources, libdirs, include)
     98             self.forceLibRefresh()
     99         self.makeLibSource(include)
--> 100         self.compileLib(libsources, libdirs)
    101 
    102     @property

C:\Anaconda3\lib\site-packages\PyDSTool\Generator\mixins.py in compileLib(self, libsources, libdirs)
     78           precompiled libraries."""
     79 
---> 80         self._builder.build(libsources, libdirs, self._compiler)
     81 
     82     def forceLibRefresh(self):

C:\Anaconda3\lib\site-packages\PyDSTool\Generator\mixins.py in build(self, libsources, libdirs, compiler)
    187                   script_args=script_args,
    188                   ext_modules=[extmod],
--> 189                   py_modules=[self.modname])
    190 
    191     def save_vfield(self, code, fname=None):

C:\Anaconda3\lib\site-packages\numpy\distutils\core.py in setup(**attr)
    167     new_attr['distclass'] = NumpyDistribution
    168 
--> 169     return old_setup(**new_attr)
    170 
    171 def _check_append_library(libraries, item):

C:\Anaconda3\lib\distutils\core.py in setup(**attrs)
    146     if ok:
    147         try:
--> 148             dist.run_commands()
    149         except KeyboardInterrupt:
    150             raise SystemExit("interrupted")

C:\Anaconda3\lib\distutils\dist.py in run_commands(self)
    953         """
    954         for cmd in self.commands:
--> 955             self.run_command(cmd)
    956 
    957     # -- Methods that operate on its Commands --------------------------

C:\Anaconda3\lib\distutils\dist.py in run_command(self, command)
    972         cmd_obj = self.get_command_obj(command)
    973         cmd_obj.ensure_finalized()
--> 974         cmd_obj.run()
    975         self.have_run[command] = 1
    976 

C:\Anaconda3\lib\site-packages\numpy\distutils\command\build_ext.py in run(self)
    115                                      verbose=self.verbose,
    116                                      dry_run=self.dry_run,
--> 117                                      force=self.force)
    118         self.compiler.customize(self.distribution)
    119         self.compiler.customize_cmd(self)

C:\Anaconda3\lib\site-packages\numpy\distutils\ccompiler.py in new_compiler(plat, compiler, verbose, dry_run, force)
    594         raise DistutilsModuleError(("can't compile C/C++ code: unable to find class '%s' " +
    595                "in module '%s'") % (class_name, module_name))
--> 596     compiler = klass(None, dry_run, force)
    597     log.debug('new_compiler returns %s' % (klass))
    598     return compiler

C:\Anaconda3\lib\site-packages\numpy\distutils\mingw32ccompiler.py in __init__(self, verbose, dry_run, force)
     56 
     57         distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose,
---> 58                                                             dry_run, force)
     59 
     60         # we need to support 3.2 which doesn't match the standard

C:\Anaconda3\lib\distutils\cygwinccompiler.py in __init__(self, verbose, dry_run, force)
    159             # Include the appropriate MSVC runtime library if Python was built
    160             # with MSVC 7.0 or later.
--> 161             self.dll_libraries = get_msvcr()
    162 
    163     def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):

C:\Anaconda3\lib\distutils\cygwinccompiler.py in get_msvcr()
     88         #     return ['vcruntime140']
     89         else:
---> 90             raise ValueError("Unknown MS Compiler version %s " % msc_ver)
     91 
     92 

ValueError: Unknown MS Compiler version 1900 

我进行了以下更改,并且它通过以下配置对我有用。

  • 操作系统:Win 7 Pro。 SP1 64位
  • CPython 3.6,64位
  • Mingw 64 (x86_64-7.1.0-posix-seh-rt_v5-rev0)
  • 赛通0.25.2

我做了以下事情

  1. 在 PATH 变量中添加 mingw (C:\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\bin for me)
  2. 通过打开命令行和命令进行测试gcc有效(我没有其他编译器)
  3. Create distutils.cfg in C:\Python36\Lib\distutils
  4. 在该文件中添加行:

    [build]
    compiler = mingw32
    
  5. 手动申请这个补丁

  6. 手动下载文件vcruntime140.dll并将其放入C:\Python36\libs
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ValueError:未知的 MS 编译器版本 1900 的相关文章

随机推荐

  • 如何将两个增量语句放入 C++“for”循环中?

    我想增加两个变量for 循环条件而不是一个 所以像这样 for int i 0 i 5 i and j do something i j 这个的语法是什么 一个常见的习惯用法是使用逗号运算符它计算两个操作数 并返回第二个操作数 因此 for
  • 记录集 .value 属性

    请参阅下面的 DDL CREATE TABLE TestDate bookingdate datetime INSERT INTO TestDate VALUES 2013 10 04 请参阅下面的 ADODB 记录集 rs open SE
  • 在 JavaScript 中设置或更改 PHP 变量

    我是 PHP 和 JavaScript 的新手 我需要获取 div 的高度并将其分配给 PHP 变量 以便稍后可以将其用于进一步的处理 暂时是这样尝试的 不过效果不太好 div style height 1 some web form co
  • 为什么数组中的输入会覆盖每行的值[重复]

    这个问题在这里已经有答案了 我有这段代码 x 3 a x x 0 for i in range 0 x for j in range 0 x dt int input insert data a i j dt print a 它应该只在被要
  • 在 React 中管理多个音频源

    我有一个 React 组件 当您单击按钮时 它会播放 暂停音频 它效果很好 我一次在一个页面上渲染大约 5 个 但是 如果您单击一个音频的 播放 然后单击另一个音频的 播放 则两个音频都会播放 这不太好 这是我的组件代码 import Re
  • 在 R Markdown 中格式化表格以导出到 MS Word 文档

    我已经开始使用expss在 R Markdown 中 在 Knitr 的帮助下生成表格 我想自动生成需要以 Microsoft Word 格式准备的报告的表格和分析 当编织到 HTML 时 表格看起来很棒 Word 中的表格显示为纯文本行
  • 三元结构不等同于 if then else

    以下 if then 测试 在 bash 中 if 1 then ls undef dummy gt dev null 2 gt 1 else echo else stmt fi 似乎不等于它的三元版本 test 1 ls undef du
  • 停止秒表

    我在 JPanel 类中有以下代码 该代码被添加到另一个类 JFrame 中 我想要实现的是某种秒表程序 startBtn addActionListener new startListener class startListener im
  • 按区域调整图像大小

    我正在尝试编写一个javascript函数来根据给定区域 或者在我的情况下 有点不准确 平均尺寸 调整图像大小 因为这更容易思考 我想要的不是输入最大高度和宽度 而是以最大面积进给 以便长或窄的图像在视觉上看起来大小大致相同 不过 我真的很
  • 如何在 Javascript 中使用 PHP 变量?

    我知道你不能直接在 javascript 代码中使用 PHP 变量 但是有办法解决吗 我需要在 javascript 中使用这些参数 username example co uk password example 它不显示 user id
  • 如何使用 ARM 模板创建标准类型逻辑应用

    我可以使用 ARM 模板通过示例工作流程创建消费类型逻辑应用程序 我想使用 ARM 模板创建带有示例工作流程的标准类型逻辑应用程序 但是 我找不到上述文档的任何参考文档 那么 任何人都可以帮我解决这个问题吗 抱歉 在我之前的回答中 我误解了
  • 如何在空手道 UI 驱动程序中处理 SSL 证书?

    When I open my resource I am faced with notification Your connection is not private Is there a way to disable the verifi
  • 从其他表中选择一个值时插入

    我想insert新值放入表中where其中一个值是从带有条件的另一个表中选择的 另一个值是常量 硬编码 该命令给出语法错误 INSERT INTO table1 itemId reservedId VALUES SELECT id FROM
  • iPhone - CLHeading 寻找方向

    在我的 iPhone 应用程序中 我使用 CLLocationManager 来查找我的 iPhone 指向的方向 我正在使用 标题 属性 它给了我 x y 和 z 值 如何从这些值中找到我当前指向的方向 北或南或东或西 你应该使用方法 l
  • 自定义查询分页 Cakephp

    我的控制器中有一个自定义查询 我想实现在 cakephp org 上找到的自定义查询分页 但他们的示例与我的示例不相似 有人可以帮我根据我的观点对这个结果进行分页吗 cars this gt Car gt query select Car
  • Java:类.this

    我有一个看起来像这样的 Java 程序 public class LocalScreen public void onMake aFuncCall LocalScreen this oneString twoString 什么是LocalS
  • PHP 会话启动“无法发送会话 cookie 和缓存限制器”

    我已将我的托管服务器从 Windows 系统更改为 Linux 系统 但是当我运行 PHP 程序时 出现以下错误 Warning session start function session start Cannot send sessio
  • 添加 firebase-ui-auth:2.3.0 依赖项时出错

    我从昨天开始就面临这个问题 我添加 Add Library compile com android support design 26 1 0 compile com firebaseui firebase ui 0 2 0 compile
  • 使用异步任务在 gridview 中加载图像,未正确加载

    我正在尝试在 gridview 异步中加载缩略图 因为其他方式显示时间太长 当我以正常方式进行操作时 它可以很好地显示图像 代码和图像 Utils public static Bitmap getThumbnail Context cont
  • ValueError:未知的 MS 编译器版本 1900

    我正在尝试使用 cygwin mingw 在 Windows 10 上使用 Python 3 5 运行一些代码 准确地说 我使用的是 PyDSTool 模块 我将其称为 dopri 积分器 问题是 我遇到了麻烦distutils无法识别 M