Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 ui to py command error
#1
Hi All,

I installed PyQt5 on my laptop and trying to convert my .ui file into .py using the command prompt and get the following errors when trying different commands:

1) C:\Python35\Lib\site-packages\PyQt5>pyuic5.bat -x FirstApp.ui -o FirstApp.py
'"C:\Python35\python"' is not recognized as an internal or external command,
operable program or batch file.

2) C:\Python35\Lib\site-packages\PyQt5>pyuic5 FirstApp.ui -o FirstApp.py
'"C:\Python35\python"' is not recognized as an internal or external command,
operable program or batch file.

3) C:\Python35\Lib\site-packages\PyQt5>pyuic4 FirstApp.ui -o FirstApp.py
'pyuic4' is not recognized as an internal or external command,
operable program or batch file.

Steps i followed on the internet include:

1) Reinstalled PyQt5
2) Made sure that the Python location on local C:/ in included in my Environmental Variables in system Settings
3) made sure that the pyuic5.bat file is located in my Python directory.

I'm not sure what else to do or try and been looking to find a solution for this. any help or advice will be gladly appreciated.

Note: I have Python 3.6 installed and PyQt5

Regards

Diovanno
Quote
#2
Hi Guys,

I tried the following to help resolve my issue. I edited my pyuic5.bat file located in C:\Python35\Lib\Site-Packages\PyQt5 as follows:

Original Script:
Quote:@"C:\Python35\python" -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9

My Edit: to point my bat file to where my Python directory is
Quote:@"C:\Program Files\Python36\python.exe" -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9

Then when i try running the convert command again i get a new error:

Quote:C:\Program Files\Python36\python.exe: Error while finding module specification for 'PyQt5.uic.pyuic' (ModuleNotFoundError: No module named 'PyQt5')

I'm not what sure to do next to get around this very frustrating error. any help will be gladly appreciated.

Regards

Diovanno
Quote
#3
How did you install pyqt? Was it through pip?
Quote
#4
Hi nilamo.

No i downloaded the exe file from the website PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x32-2.exe and installed all features and added ticked 'Add PATH" in below options.

regards

Hi All,

I managed to fix the error. I re-installed Python directly to the C:\Python36 location, edited my pyuic5.bat file so that it has the new location. I also used CMD and installed the latest PyQt5.10 via the pip command like nilamo mentioned. Results below:

Quote:C:\Python36\Scripts>pip install pyqt5
Collecting pyqt5
Downloading PyQt5-5.10.1-5.10.1-cp35.cp36.cp37.cp38-none-win_amd64.whl (81.0MB)
100% |████████████████████████████████| 81.0MB 7.7kB/s
Collecting sip<4.20,>=4.19.4 (from pyqt5)
Downloading sip-4.19.8-cp36-none-win_amd64.whl (51kB)
100% |████████████████████████████████| 51kB 1.1MB/s
Installing collected packages: sip, pyqt5
Successfully installed pyqt5-5.10.1 sip-4.19.8

After this i was able to convert my .ui files.

Thanks all for the help, especially nilamo for hinting me in the right direction.

Regards

Diovanno
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)