python - Qt5 qmake-找不到合适的Python 2版本

标签 python compiler-errors qt5

我的目标是从源代码构建QtWebEngine,下面的步骤是我为尝试实现此目的而执行的操作。我收到关于找不到Python 2的错误。

到目前为止,我已经安装了什么:

  • Qt5.12.6(从他们的在线安装程序-sourcemsvc2017msvc2017_64msvc2015qtwebengine)
  • Microsoft Visual Studio 2019(来自他们的网站)
  • Python 2.7.17Python 3.8.0(2.7.17来编译Qt的部分,3.8.0进行常规编码-都来自python.org)

  • 我需要从源代码重建QtWebEngine,为此,我要按照以下步骤操作:在CMD中键入以下内容,并在每个项目符号点后按Enter键:
  • cd "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
  • vcvars64.bat

  • 该命令的输出为:
    **********************************************************************
    ** Visual Studio 2019 Developer Command Prompt v16.2.0
    ** Copyright (c) 2019 Microsoft Corporation
    **********************************************************************
    [vcvarsall.bat] Environment initialized for: 'x64'
    
  • cd \
  • cd Qt\5.12.6\Src\qtwebengine
  • "C:\Qt\5.12.6\msvc2017_64\bin\qmake.exe" -- -webengine-proprietary-codecs

  • 最后一个项目符号点的输出为:
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Qt WebEngine:
      Embedded build ......................... no
      Full debug information ................. no
      Pepper Plugins ......................... yes
      Printing and PDF ....................... yes
      Proprietary Codecs ..................... yes
      Spellchecker ........................... yes
      Native Spellchecker .................... no
      WebRTC ................................. yes
      Use System Ninja ....................... no
      Geolocation ............................ yes
      WebChannel support ..................... yes
      Use v8 snapshot ........................ yes
      Kerberos Authentication ................ yes
    
    WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine.
    
    Qt is now configured for building. Just run 'nmake'.
    Once everything is built, you must run 'nmake install'.
    Qt will be installed into 'C:\Qt\5.12.6\msvc2017_64'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    
    
    A suitable version of python2 could not be found.
    QtWebEngine will not be built.
    

    我已经从python.org安装了Python 2.7.17,它的文件位置是C:\Python27
    文件路径:
    C:\Python27
    C:\Python27\scripts
    

    都以PATH的顺序排列。我还在Python 3.8.0文件夹上方的PATH中存储了2个Python 2.7.17文件夹(与上面相同)。
    我正在Windows 10 (64 bit)上运行

    在尝试构建Python 2.7.17时,为了使Qt5.12.6能够识别QtWebEngine,我必须做什么?

    最佳答案

    从PATH中删除Python 3.8.0。
    引用https://doc.qt.io/qt-5.12/qtwebengine-platform-notes.html
    注意:在Qt 5.15构建要求中,它提到了
    使用Python 2.7.5或更高版本。不支持Python 3。

    关于python - Qt5 qmake-找不到合适的Python 2版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59203750/

    相关文章:

    c++ - Dlib 错误 : error C1083: Cannot open include file :'type_safe_union/type_safe_union_kernel.h'

    c++ - QMake 找不到 GraphicsMagick 库

    qt - Qt5 如何检查 url 是否可用?

    python - .rjust() 是如何工作的

    python - 如何使用 python 中的分页从 API 创建有效的 json 文件?

    c++ - Clang 的 "did you mean ...?"变量名修正算法是如何工作的?

    qt - 在行布局中垂直对齐项目

    python - 具有任意数量空格的 '.' 分隔词的模式

    python - 如何从 python 中的数组导入模块?

    compiler-errors - 使用 Eclipse Android 编译 FFMPEG