这一步一定要选中ui文件之后再点pyuic,不然会报错

pyqt5 pyuic生成py文件报错Error in input file: no element found: line 1, column 0

C:\Users\83942\AppData\Local\Programs\Python\Python37\Scripts\pyuic5.exe main.py -o main.py
Error in input file: no element found: line 1, column 0

这时候运行的命令是pyuic5.exe main.py -o main.py

而不是pyuic5.exe xxx.py -o xxx.ui

报错是提示找不到ui文件

原因

pyqt5 pyuic生成py文件报错Error in input file: no element found: line 1, column 0

(因为很多人pyuic的arguments都是$FileName$ -o $FileNameWithoutExtension$.py,即通过xxx.ui生成xxx.py)

如果不选中ui文件,pycharm会按照你当前文件作为xxx.ui进行转换

 

相关文章:

  • 2021-05-16
  • 2021-10-24
  • 2020-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2022-01-14
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2021-08-11
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
相关资源
相似解决方案