0

I've installed python 3.5.0

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32

Then installed Qt5 : pip install python-qt5.

Here code :

import sys
from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)
button = QtWidgets.QPushButton("Hello")
button.setFixedSize(400, 400)
button.show()
app.exec_()

It return error:

C:\Python35\python.exe C:/py_test/test_qt5/main.py
Traceback (most recent call last):
  File "C:/py_test/test_qt5/main.py", line 2, in <module>
    from PyQt5 import QtWidgets
ImportError: DLL load failed: The specified module could not be found.

Here is my PATH:

C:\Python35\Scripts\;C:\Python35\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Skype\Phone\;C:\Python35\Lib\site-packages\PyQt5\;

Please adwise. Thanks

UPDATE: I have Qt5Widgets.dll and QtWidgets.pyd in C:\Python35\Lib\site-packages\PyQt5

Vlad
  • 73
  • 1
  • 10

2 Answers2

0

Do you have the binaries in C:\Python35\Lib\site-packages\PyQt5\ or are them in C:\Python35\Lib\site-packages\PyQt5\bin?

Check if C:\Python35\Lib\site-packages\PyQt5\bin exists and add the path to your environment PATH variable.

Tarod
  • 6,732
  • 5
  • 44
  • 50
  • 1
    i have binaries/dlls in C:\Python35\Lib\site-packages\PyQt5\ , and there is no bin\ directory C:\Python35\Lib\site-packages\PyQt5\ exist in PATH variable – Vlad Sep 15 '15 at 11:50
  • 1
    @Vlad Maybe this helps you: http://stackoverflow.com/questions/2738879/cannot-import-pyqt4-qtgui and http://stackoverflow.com/questions/2140836/pyqt-4-7-importerror-after-installing-on-windows? – Tarod Sep 15 '15 at 11:57
  • i've reinstalled to x86 python35, and getting 'ImportError: DLL load failed: %1 is not a valid Win32 application.' now – Vlad Sep 15 '15 at 13:01
  • hey i am using python 3.6 i found the bin folder in C:\Python35\Lib\site-packages\PyQt5\Qt\bin . So try adding that to environment variable path in windows 7 – kinsley kajiva Apr 27 '17 at 08:57
0

So, PyQt5 will not work with python3.5

downgrading to python 3.4 solved problem

Vlad
  • 73
  • 1
  • 10