[pyside] pyside-uic xxx.ui -o xxx

    技术2025-11-20  10

    今天在用pyside的时候,碰到一条命令 pyside-uic xxx.ui -o xxx_ui.py 可是执行它的时候,终端显示没有这条命令, 于是, 我马上想到,这应该是还没有安装的一个程序, google了好一阵,原来,需要安装一个库,命名如下: sudo apt-get install pyside-tools 灵感来源网址: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=545022 可是,执行 pyside-uic xxx.ui -o xxx_ui.py 依然报错:

    An unexpected error occurred.

    极其蛋疼的事情发生了, 经过经理点拨, 继续google,终于找到了如下信息, 一个字‘爽’:

    Hi, I'm working on KUbuntu 10.04, and issued the same problem as you do. As crazy as it seems, you can make it work by simply removing a file : sudo rm /usr/lib/pymodules/python2.6/pysideuic/widget-plugins/__init__.py It seems that the dynamic plugin loader is trying to execute it as if it was a plugin, but it is not, so removing it just works. However, the exception generated by the script should be caught and not make everything fail, so maybe this problem should be reported to the PySide guys ? 灵感来源网址: http://lists.openbossa.org/pipermail/pyside/2010-October/001156.html
    最新回复(0)