gpt4 book ai didi

python - cygwincompiler 类型错误 : '>=' not supported between instances of 'NoneType' and 'str'

转载 作者:行者123 更新时间:2023-11-28 21:38:01 24 4
gpt4 key购买 nike

File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\mingw
dry_run, force)
File "C:\ProgramData\Anaconda3\lib\distutils\cygwinccompiler.py", line
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
在我的Python环境中长期面对这个错误,不知道是不是cygwin的原因。

最佳答案

  • 您需要将下面的 2 行添加到名为 distutils.cfg 的新文件到 python/Lib/distils python 安装。这将防止在原始问题中看到的“vcvarsall.bat”错误或“Visual C++ 要求”错误或 NoneType 错误。 (假设“distutils.cfg”文件不存在)
    [build]
    compiler=mingw32.exe

    (Note: The ".exe" portion is very important here, and many other guidelines tend to leave this out!)
  • 将补丁添加到 Python/Lib/disutils/cygwinccompiler.py。将 get_msvcr() 方法更改为 this file 中看到的方法由我自己组织为 python 选项卡安全,或者以其他方式应用来自特定 bug fix python page 的更改. (请注意,如果将官方页面的代码复制到 cygwinccompiler.py get_msvcr 方法中,即使删除了不相关的加号,并确保所有内容对齐,也会产生错误。您需要删除选项卡,并替换它们与相应数量的空格。)
  • 关于python - cygwincompiler 类型错误 : '>=' not supported between instances of 'NoneType' and 'str' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48764602/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com