【问题标题】:PyQt setup for Qt 4.7.4Qt 4.7.4 的 PyQt 设置
【发布时间】:2011-12-12 20:47:43
【问题描述】:

我尝试安装 PyQt 以使用 Qt 开发 Python 应用程序。 我从http://www.riverbankcomputing.co.uk 下载了 SIP 和 PyQt4 并编译了包。

但是我在编译PyQt4的时候遇到了问题:

我在终端中运行了 python configure.py,得到了:

Error: Make sure you have a working Qt v4 qmake on your PATH or use the -q
argument to explicitly specify a working Qt v4 qmake.

我查看了 Qt 设置,看到了此处定义的 qmake 路径“home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake”。这条路径还应该设置在哪里?

我如何配置 qt,以便我可以直接将代码写入 Qt Creator 并从那里执行它,例如任何其他 c++ 文件。我从诺基亚网站安装了 Qt,它安装在 /home/user/.QtSDK 文件夹中。

谢谢。

【问题讨论】:

标签: python qt compilation pyqt configure


【解决方案1】:

错误消息说 PyQt 安装程序找不到 qmake 可执行文件。 运行这两个命令应该可以解决它:

PATH=$PATH:~/.QtSDK/Simulator/Qt/gcc/bin/
export PATH

之后,继续安装。

【讨论】:

  • 很抱歉,当我说它不起作用时,这是我的错误。我忘了用我的用户名替换“用户”。成功了,谢谢。
  • 我已将 PATH 添加到我的 profile.sh 文件中。这解决了我的问题。感谢您的建议。
【解决方案2】:
make -q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake

这行得通吗?我不确定你运行 make 时是否出现错误,但我认为是这样。如果没有,请将-q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake 添加到正确的命令中。

【讨论】:

  • 从终端运行python configure.py 后出现错误。运行make -q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake 后,我得到make: *** No rule to make target /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake'。停止。`也尝试过:python -q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake configure.py,但我得到了Unknown option: -q usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ... Try python -h'以获取更多信息。`
  • @JohnSmith 然后python configure.py -q /home/user/.QtSDK/Simulator/Qt/gcc/bin/qmake
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-12-19
  • 2011-06-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多