I have just installed Anaconda 5.2 with Python 3.6 on my windows system. Also installed pyqt5 and pyqt5-tools via pip with administrator privilege. Now when I run pyuic5.exe for converting ui files it shows following error:
Traceback (most recent call last):
File "C:\Users\AshfaqurRahman\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\AshfaqurRahman\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\AshfaqurRahman\AppData\Roaming\Python\Python36\site-packages\PyQt5\uic\pyuic.py", line 26, in <module>
from PyQt5 import QtCore
ModuleNotFoundError: No module named 'PyQt5.sip'
I have tried installing PyQt5-sip package using pip. Buts its already installed in my system.
Why this problem is occurring? How can I solve this problem?
I am a Mac user and I had faced a similar issue. However, I understand for window users, what you are looking for is
pyuic5.bat
and notpyuic5.sip
It seems you'll simply have to provide the full path of the pyuic file(for me, it was under a hidden folder usr in the home directory:/usr/local/Cellar/pyqt/5.10.1_1/bin/pyuic5
) and do make sure on your terminal(for you, cmd) you have the directory changed to where the *.ui file lies which you wish to convert to a *.py file.So for instance, if you have a
Qt
designer file saved by the name untitled.ui on your desktop, put in the following command in your terminal:Hope this helps... Cheers
As of June 2019, pyqt5-tools no longer exists. The solution I found was first installing
pyqt5-sip
and then installpyqt5
This seems to get rid of the following error:
ModuleNotFoundError: No module named 'PyQt5.sip'
None of the answers above worked for PyQt5 5.13.0 on conda's python 3.6.
With
pyqt5
andpyqt5-sip
installed just go into python's site-packages and copysip.so
from thePyQt5_sip
package toPyQt5
folder (or make a symlink) where the rest of Qt's so modules are.Seems like a poor decision to pull sip out into a separate package.
According to Agile_Eagle's suggestion from the comments I just uninstalled
pyqt5
andpyqt5-tools
packages and the reinstalled them. Problem solved!PS.: If you still got problems with PyQt, try uninstalling all of the PyQt related libraries:
Then install them again, this will fix:
PPS.:If you got problems uninstalling the libraries, go to your Python folder, like
C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python<PYTHON-VERSION>\Lib\site-packages
and manually delete the PyQt folders, then uninstall everything and install again (Make sure you have the latest Python version and upgraded your pip too)