Fix pyuic5 Error: one input ui-file must be specified – PyQT5 Tutorial

By | April 13, 2021

When we use pyuic5 command to convert ui file created by qt designer, we may get this error:

Error: one input ui-file must be specified

In this tutorial, we will introduce you how to fix.

Look at converted command below:

pyuic5 -o C:\Users\fly165\Desktop\PDF Page Spliter\main_help.py C:\Users\fly165\Desktop\PDF Page Spliter\main_help.ui

Run this command, you will get this error:

Fix pyuic5 Error - one input ui-file must be specified

Why does this error occur?

Because there exists some spaces in path.

For example:

C:\Users\fly165\Desktop\PDF Page Spliter\main_help.py

There are some spaces in string “PDF Page Spliter“.

How to fix this error?

It is easy to fix this error, change command to below:

pyuic5 -o "C:\Users\fly165\Desktop\PDF Page Spliter\main_help.py" "C:\Users\fly165\Desktop\PDF Page Spliter\main_help.ui"

Run this code, you will find ui file is converted successfully.

use pyuic5 to convert to ui file to python script file

Leave a Reply

Your email address will not be published. Required fields are marked *