pyside-uic 在哪里?
我正在尝试使用 Qt Designer 和 pyside-uic mydesign.ui > design.py
但是,这个程序不存在。我查看了 python 2.7 下的站点包,我看到: pyside-lupdate.exe pyside-rcc.exe
和一堆其他程序,但没有 pyside-uic.exe 这样的东西......为什么?为什么安装包里没有这个?我在哪里可以得到它?
I'm trying to use Qt Designer and pyside-uic mydesign.ui > design.py
however, this program doesn't exist. I looked in site packages under python 2.7, and I see:
pyside-lupdate.exe
pyside-rcc.exe
and a bunch of other programs, but there is no such thing as pyside-uic.exe ... why ?? Why is it missing from the installation package? Where do I get it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
几年过去了,有些问题得到了解决:我想现在的官方答案是:
使用
uic.exe
!但如何呢?因此,尽管官方文档仍然缺乏有关它的任何信息,但你现在可以编译<使用通过
pip install PySide2
获得的 PySide2 包附带的可执行文件,直接将 code>.ui 文件传输到 Python。您可以这样编写它:其中
your_design.ui
是 Qt Designer 文件,your_design_ui.py
是要生成的目标 Python 文件。瞧!顺便说一句:这是来自
uic -?
的帮助Since a couple years passed by and some things were fixed: I guess the official answer would now be:
Use
uic.exe
! But how?So although the official docs still lack any info about it you can now compile
.ui
files to Python directly with this executable shipped with the PySide2 package you get viapip install PySide2
. This is how you would write it:Where
your_design.ui
is the Qt Designer file andyour_design_ui.py
the target Python file to generate. Voilà!Btw: here is the help from
uic -?
如果有人需要它,对于 Ubuntu 18.04,我需要先安装 pyside-tools 包。希望有帮助。
In case someone need it, for Ubuntu 18.04 I need to install pyside-tools package first. Hope that helps.
如果您使用自制程序安装了 PySide,则还需要安装 pyside-tools 包才能获取这些命令行工具:
If you installed PySide with homebrew, you need to install
pyside-tools
package also to get these command line tools:您应该看到 /Python27/Scripts/pyside-uic.exe。但我想知道为什么它不可见(不可执行)。也许这是一个包装问题(权限等)。您可以尝试使用完整路径来调用它。
You should see a /Python27/Scripts/pyside-uic.exe. But I'm wondering why it's not visible (not executable). Maybe it's a packaging problem (permissions, etc). You could try to call it using the complete path.
当我使用 conda 安装时,py-uic.exe 未解压。通过卸载并使用 pip 解决了该问题。
When I installed using conda, the py-uic.exe was not unpacked. The problem was fixed by uninstalling and using pip.
对于 Mac,它适用于我运行以下命令(需要安装 macports):
它安装在我的 Python 2.7 环境中。
我希望它有帮助。
For Mac it worked for me running the following command (needed to have macports installed):
It installs on my Python 2.7 environment.
I hope it helps.