user3723727
user3723727

Reputation: 142

Convert UI file to Python Using pyuic4 Issue

I'm trying to convert a ui file to python using pyuic4 but I get "The system cannot find the path specified". (pyuic4 Mainwindow.ui > MainWindow.py) I'm not sure why since I've given the command line the exact location of the file (pyuic4) in Anaconda. If I use pyuic5 it does the conversion without a problem (pyuic5 Mainwindow.ui > MainWindow.py). I'm using Windows with Anaconda3. Anyone have any ideas what the problem might be?

Upvotes: 2

Views: 3592

Answers (1)

Zack Graber
Zack Graber

Reputation: 1136

I just ran into this myself. It looks like the Anaconda build has an issue. pyuic4.bat has some machine dependent paths that need to be changed to match your system.

Original pyuic4.bat text (Notice the path)

@"C:\aroot\stage\python" "C:\aroot\stage\Lib\site-packages\PyQt4\uic\pyuic.py" %1 %2 %3 %4 %5 %6 %7 %8 %9

Correct Anaconda text:

@"C:\Anaconda\python" "C:\Anaconda\Lib\site-packages\PyQt4\uic\pyuic.py" %1 %2 %3 %4 %5 %6 %7 %8 %9

Correct Anaconda3 text:

@"C:\Anaconda3\python" "C:\Anaconda3\Lib\site-packages\PyQt4\uic\pyuic.py" %1 %2 %3 %4 %5 %6 %7 %8 %9

Upvotes: 3

Related Questions