I've downloaded the file "qt-unified-windows-x86-3.0.0-online.exe" and installed Qt and I've also downloaded and unpacked the file "PyQt5_gpl-5.9.zip". I'm using Python 3.6 but I can't figure out where to drop the extracted PyQt5 files. I can't find a Python directory anywhere on my C: drive except for under my home directory.
C:\Users\me\AppData\Local\Programs\Python

Any ideas where I can drop these files and how do I validate that I have Qt up an running in Python? Thanks.

Dani AI

Generated

Quick summary and a compact, up‑to‑date checklist.

ended up unpacking a PyQt archive and — as suggested — discovered the easiest path is to use the prebuilt packages instead of copying files by hand. That also explains why switching to an older Python binary worked: the bindings you used were compiled for a particular CPython ABI/bitness.

Prefer prebuilt wheels and isolate installs: use the binary PyQt packages on PyPI rather than dropping unbuilt files into site‑packages, and create a project virtual environment so pip installs go to the interpreter you expect. Also confirm the interpreter’s bitness and Python major version match the wheel you install (wheels are platform/ABI specific). PyPI: PyQt5. venv docs. [platform/sys notes on bitness]. (pypi.org)

Quick validation snippet (run inside the same interpreter/venv you installed into):

from PyQt5.QtWidgets import QApplication, QLabel
app = QApplication([])
lbl = QLabel("PyQt OK")
lbl.show()
app.exec_()

If that creates a small window, the binding and Qt runtime are available to that Python. If the import fails, it usually means either the wheel wasn’t for that Python/architecture or you used an sdist that requires building against a Qt installation.

If Qt C++ DLLs can’t be found at runtime (missing platform plugin, Qt5Core, etc.), don’t copy random DLLs — use the Qt deployment tooling or ensure the Qt bin directory used to build the bindings is discoverable at runtime. For an official alternative to Riverbank’s PyQt, the Qt Company maintains “Qt for Python” (PySide) packages on PyPI. [Qt Windows deployment / windeployqt]. [Qt for Python]. (doc.qt.io)

Troubleshooting pointers: re-create a clean venv with the intended Python executable, check the interpreter bitness, install the matching binary wheel from PyPI (avoid manual unpacking of source zips unless you want to build), and consult the Qt deployment docs if DLL/plugin errors persist.

Recommended Answers

All 2 Replies

Is there a setup.py file in the extracted hierarchy? If so, open a terminal (cmd window), go to the directory where the setup.py file is and type python setup.py install. Before that, make sure that the python command invokes the python 3.6 interpreter.

EDIT: from what I read on the pyqt5 website, the best way to install pyqt5 is not by downloading the zip file, but by running

pip3 install pyqt5

in a cmd window, or perhaps py -m pip install pyqt5 (because the pip interface changed slightly in python 3.4 and I don't use windows)

Don't you have a C:\Python36 folder ? You can get the path to your python executable by running

python -c "import sys; print(sys.executable)"

You can get the paths that python use to import modules by running

python -c "import sys; print(sys.path)"

Thanks. I finally got it. I had to run python 3.4, Qt wouldn't work with python 3.6. Go figure.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.