-
Notifications
You must be signed in to change notification settings - Fork 34
Getting going with PyQt5
PyQt5 is cross-platform GUI toolkit, a set of python bindings for Qt v5.
To run bdedit
you must have Qt installed. It is not specified as a dependency for bdsim
since the whole aim of bdsim
is to do block diagrams with code not diagrams.
For most platforms installing PyQt5 is as simple as
pip install PyQt5
and you test your install by running
python bdsim/bdedit/pyqt5_hello.py
which results in the following popup
There are lots of online resources related to installing and debugging PyQt5, I will ignore GitHub Issues posted on this topic.
PyQt5 is meant to be cross-platform but running on Apple Silicon is not quite so straightforward. This is what worked for me:
brew install qt
brew install pyqt5
which seems to install it into the site-packages
folder for all your current python versions.
To use it, you need to set the python path according to the version of Python you want this to work for. For the case of Python 3.9 and using tcsh/csh write:
setenv PYTHONPATH /opt/homebrew/opt/pyqt5/lib/python3.9/site-packages
and for bash write:
export PYTHONPATH=/opt/homebrew/opt/pyqt5/lib/python3.9/site-packages
Test your install by running
python bdsim/bdedit/pyqt5_hello.py
If you have issues check out the relevant online resources. I will ignore GitHub Issues posted on this topic.
Copyright (c) Peter Corke 2020-23
- Home
- FAQ
- Changes
- Adding blocks
- Block path
- Connecting blocks
- Subsystems
- Compiling
- Running
- Runtime options
- Discrete-time blocks
- Figures
- Real time control
- PID control
- Coding patterns