Search code examples
pythonpyqt5file-not-foundpyuic

pyuic5 not finding file


I am learning PyQt5, and while converting a ui to py, it throws this error:

Error: No such file or directory: "Disaster.ui"

The file name is Disaster.ui. The command is:

pyuic5 -x Disaster.ui -o abc.py

Solution

  • The error occurs because the file Disaster.ui does not exist in the current folder (i.e. wherever you're executing pyuic5 from). To prove this, execute dir *.ui.

    To fix it, either cd to the relevant folder, or use an absolute path instead.