最近因为项目问题,需要实现一些自动化测试用例,在网上搜寻一番,发现了robotframework这个自动化测试框架,而且还有易于使用的GUI界面RIDE,但是在安装过程中发现安装失败的问题,记录一下。

Building wheels for collected packages: wxPython
  Building wheel for wxPython (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      running bdist_wheel
      running build
      Will build using: "d:\program files\python\python37\python.exe"
      3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.1

      Running command: build
      Running command: build_wx
      Command '"d:\program files\python\python37\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x64', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
      Traceback (most recent call last):

        File "<string>", line 1, in <module>

        File "d:\program files\python\python37\lib\site-packages\setuptools\msvc.py", line 1218, in __init__

          self.si = SystemInfo(self.ri, vc_ver)

        File "d:\program files\python\python37\lib\site-packages\setuptools\msvc.py", line 690, in __init__

          vc_ver or self._find_latest_available_vs_ver())

        File "d:\program files\python\python37\lib\site-packages\setuptools\msvc.py", line 705, in _find_latest_available_vs_ver

          'No Microsoft Visual C++ version found')

      Command '"d:\program files\python\python37\python.exe" -u build.py build' failed with exit code 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for wxPython
  Running setup.py clean for wxPython
Failed to build wxPython
ERROR: Could not build wheels for wxPython, which is required to install pyproject.toml-based projects

错误信息大致如上,看起来是因为电脑中的Visual C++编译环境没有安装,导致在编译出现了问题。

下面说明下如何进行windows Visual C++编译工具安装。
现在官网已经有了独立安装的工具,可以自行选择。
https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/
下载后进行选择安装Visual Studio生成工具。

最后修改:2024 年 01 月 23 日 11 : 45 AM