Home / Guides / Install

How to Install PyQt with pip (Windows, macOS, Linux)

A complete PyQt install guide: check Python, make a virtual environment, run pip install PyQt6, verify it, and open Qt Designer — on Windows, macOS and Linux.

INSTALL

How to Install PyQt with pip (Windows, macOS, Linux)

Installing PyQt takes about a minute once Python is ready. This guide covers every step — a virtual environment, the install itself, a quick test, and the designer tools — on all three operating systems, with fixes for the usual snags.

Step 1 — Check Python

PyQt6 6.11 needs Python 3.10 or newer. Check what you have before anything else:

terminal
python --version   # or python3 --version

If the number is below 3.10, install a newer Python from python.org. On Windows, tick Add Python to PATH so the commands below work from any folder.

Step 2 — Make a virtual environment

A virtual environment keeps PyQt separate from your other projects. It is a good habit and avoids clashes later. Create and activate one like this:

terminal
python -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

Once it is active, your prompt shows the environment name. Everything you install now lives inside that folder, not across your whole system.

Step 3 — Install PyQt6

Upgrade pip first, then install PyQt6:

terminal
python -m pip install --upgrade pip
pip install PyQt6

Using python -m pip matters. It makes pip install into the same Python you run your scripts with. That one habit prevents the most common error of all, which we cover below.

Step 4 — Verify it works

Confirm the version first:

terminal
python -c "import PyQt6.QtCore as c; print(c.PYQT_VERSION_STR)"

You should see something like 6.11.0. Now prove it draws a window:

app.py
from PyQt6.QtWidgets import QApplication, QLabel
app = QApplication([])
QLabel("PyQt is installed!").show()
app.exec()

Run it with python app.py. A small window should pop up. If it does, your install is healthy.

Step 5 — Qt Designer and tools

Want to build screens by dragging widgets? Add the tools package:

terminal
pip install pyqt6-tools
pyqt6-tools designer

On some systems Qt Designer ships with the official Qt install instead of pyqt6-tools. Either way, the .ui files it makes work the same. See our Qt Designer guide.

Notes for each OS

Windows. Use Command Prompt or PowerShell. No extra system libraries are needed. The wheel covers everything.

macOS. If both Python 2 and 3 are present, use python3 and pip3. Apple Silicon and Intel both have wheels, so the install is automatic.

Linux. If you hit a message about the xcb platform plugin, install the system libraries: sudo apt install libxcb-cursor0 and related xcb packages. You can also use your distro's own python3-pyqt6 package instead of pip.

Upgrading PyQt later

New PyQt releases arrive a few times a year, usually to track a new Qt version. Upgrading is a one-line job. Add the upgrade flag to the normal install command and pip pulls the latest build.

terminal
python -m pip install --upgrade PyQt6

Upgrade inside the same virtual environment you built the project in. That way the change is contained, and if anything misbehaves you can rebuild the environment without touching the rest of your system.

Installing add-on modules

The core package covers widgets, layouts and the common classes. Some features live in separate packages. Charts, 3D, WebEngine and others each install on their own.

The golden rule is to match versions. If you run PyQt6 6.11, install the 6.11 line of each add-on. Mismatched numbers are a frequent cause of odd import errors, and matching them clears most of those up before they start.

Starting clean

If an install ever gets into a strange state, the fastest cure is a fresh environment. Delete the old venv folder, create a new one, and install again. Because everything lived inside that folder, nothing else on your machine is affected.

This "throw it away and rebuild" habit is one of the quiet superpowers of virtual environments. It turns a scary, tangled problem into a thirty-second reset.

A sensible project structure

Once PyQt is installed, a little structure goes a long way. Keep your virtual environment in the project folder, your main script at the top, and a requirements.txt listing your dependencies. This makes the project easy to share and easy to rebuild.

As the app grows, add folders for your own modules and for any resources such as icons or .ui files. A tidy layout from day one saves you from a messy clean-up later, when the project has dozens of files.

Write down the setup steps in a short README too. Future you, and anyone you work with, will be grateful for a two-line reminder of how to get the project running.

Your first run, step by step

With everything installed, here is the full first run. Activate your virtual environment so the right Python is in charge. Save the three-line hello-world snippet into app.py. Then run it from the terminal with python app.py.

A small window should appear almost instantly. If it does, every part of your setup works: Python, pip, PyQt and Qt are all talking to each other. That is the green light to start building something real.

If the window does not appear, do not worry. Run the command from a terminal so you can read the message, and check our troubleshooting guide. Almost every first-run problem has a one-line fix.

Key takeaways

A smooth PyQt install follows the same five beats every time. Check that Python is 3.10 or newer. Create and activate a virtual environment. Upgrade pip, then install PyQt6. Verify the version. Add the tools package if you want Qt Designer.

The one habit that prevents the most pain is running pip through python -m pip. It keeps pip tied to the Python you actually run, which sidesteps the classic "No module named PyQt6" error before it can appear.

If anything ever feels tangled, remember the reset. Delete the environment folder, make a fresh one, and install again. Because everything lived inside that folder, you lose nothing and gain a clean slate in under a minute.

FAQs

Why does Python say "No module named PyQt6"?

pip installed into a different Python than the one you run. Fix it with python -m pip install PyQt6 so both match.

Do I have to use a virtual environment?

No, but it is strongly advised. It keeps projects clean and makes it easy to start over if something breaks.

Can I install PyQt6 offline?

Yes, if you download the wheel on another machine and copy it over, then run pip install on the file. Online is far easier, though.

Is Qt Designer included?

Not in the core package. Add pyqt6-tools, or use the Designer that comes with a full Qt install.

Conclusion

That is the whole install: check Python, make an environment, run one pip command, and test a window. Keep python -m pip in mind and most problems never appear. If something still goes wrong, our troubleshooting guide has the fixes. When you are ready, try building a real app with our first example.

Ready to start? Download PyQt or run pip install PyQt6.